-
Notifications
You must be signed in to change notification settings - Fork 16
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
deadfixture doesn't support pytest-lazy-fixture #21
Comments
Any updates? |
@spumer I'll take a look again at lazy fixture code, the last time I checked there was no reliable way to say that a fixture is being used, if that is the case, I'll close this with |
I found that there is the same problem with fixtures that are only used in |
Sorry, my bad, this fixture was really unused. The whole file with tests was ignored because of forgotten So this tool helps in refactoring, very nice! |
Holy moly! I'm facing this issue... What did you guys do to handle this problem? |
@jeffersfp sorry for the delay. I'm planning a rewrite of this plugin to clean up the code a bit and make the options behavior more consistent, during this it might be possible that this problem is solved as a side-effect. So, I'm closing this considering as a decision "by-design". |
@jllorencetti Agree with your approach of rewriting to avoid certain (anti-)patterns, but it may not be possible for fixtures overriden by the user that are called dynamically / lazily by libraries. For this use case, I request that we address #27 |
The pytest-lazy-fixture plugin makes possible to use a fixtures inside
pytest.mark.parametrize
:In this example,
deadfixtures
doesn't detect the fixtureone
being used and returns the warning.Ref: There is a proposal in Pytest to make this behaviour possible out of the box: https://docs.pytest.org/en/latest/proposals/parametrize_with_fixtures.html
The text was updated successfully, but these errors were encountered: