Add `--used-fixtures` command
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.
@jllorencetti can we accept this PR? This really good feature
@malthejorgensen could you please rebase your branch with main?
@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).
Codecov Report
Merging #23 (16f472f) into main (e7d25cc) will increase coverage by
1.48%. The diff coverage is75.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.
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 this changes looks good for me! @jllorencetti do you have any point?