pytest-deadfixtures icon indicating copy to clipboard operation
pytest-deadfixtures copied to clipboard

Add `--used-fixtures` command

Open malthejorgensen opened this issue 7 years ago • 6 comments

This new --used-fixtures command lists fixtures used in the tests that are run.

There might already be a builtin pytest command to do this, but I couldn't find it, so this might be useful for the next person passing by.

About the PR I have expanded some of the existing tests, but somewhat naïvely (there's probably a nicer way to test the new command?). Also, I didn't know what to do for the doctest-tests.

malthejorgensen avatar Sep 26 '18 09:09 malthejorgensen

@jllorencetti can we accept this PR? This really good feature

spumer avatar Jul 25 '21 08:07 spumer

@malthejorgensen could you please rebase your branch with main?

jairhenrique avatar Dec 11 '22 20:12 jairhenrique

@jairhenrique I've rebased this branch as well as updated the base branch from master to main.

The code is quite old so I'm not 100% whether it works with the changes made in the base branch. I can see that I did add tests in this branch, but I don't remember how they work anymore (whether they cover enough functionality to indicate that it fully works).

malthejorgensen avatar Dec 11 '22 21:12 malthejorgensen

Codecov Report

Merging #23 (16f472f) into main (e7d25cc) will increase coverage by 1.48%. The diff coverage is 75.00%.

@@            Coverage Diff             @@
##             main      #23      +/-   ##
==========================================
+ Coverage   66.66%   68.15%   +1.48%     
==========================================
  Files           1        1              
  Lines         126      157      +31     
  Branches       28       35       +7     
==========================================
+ Hits           84      107      +23     
- Misses         35       41       +6     
- Partials        7        9       +2     
Impacted Files Coverage Δ
pytest_deadfixtures.py 68.15% <75.00%> (+1.48%) :arrow_up:

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

codecov-commenter avatar Dec 11 '22 21:12 codecov-commenter

Tests / Python 3.11 (pull_request) was failing due to linting/black so I updated the commit to follow black formatting as set up in this repo (line length: 90).

malthejorgensen avatar Dec 11 '22 21:12 malthejorgensen

@malthejorgensen this changes looks good for me! @jllorencetti do you have any point?

jairhenrique avatar Dec 11 '22 21:12 jairhenrique