Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add --used-fixtures command #23

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

malthejorgensen
Copy link

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.

@spumer
Copy link

spumer commented Jul 25, 2021

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

@jairhenrique
Copy link
Collaborator

@malthejorgensen could you please rebase your branch with main?

@malthejorgensen malthejorgensen changed the base branch from master to main December 11, 2022 21:08
@malthejorgensen
Copy link
Author

@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-commenter
Copy link

codecov-commenter commented Dec 11, 2022

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%) ⬆️

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

@malthejorgensen
Copy link
Author

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).

@jairhenrique
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants