Pytest fixtures are wrongly defined as unused
Describe the bug
Packages that are used just as pytest fixtures are wrongly set as unused.
To Reproduce
Steps to reproduce the behavior:
- Install
pytest-freezeras an example - Create a test that uses that fixture, e.g.
def test_frozen(freezer):
freezer.move_to("2021-01-01T00:00:00")
- Verify that
deptrywill flag the package.
Expected behavior
The package should not be flagged.
Additional context
I'm not sure if there's a way to do that, or if it's too much outside of the scope of the package. But I'd say this is probably a big enough use case (supporting pytest) that maybe it should be taken into account.
Development dependencies are not flagged as unused packages, and usually packages that are only meant to be used in dev/tests should be specified in development specific dependencies groups. I don't know about your setup, nor which package manger you use, but if possible, it would be recommended to declare pytest-freezer as a development package in your dependencies.