Open
Description
What's the problem this feature will solve?
I'm tired of putting so much code in a single tests/conftest.py
file.
Describe the solution you'd like
It'd be nice if I could expand conftest.py
into a folder, like this:
tests/conftest/__init__.py # loaded instead of conftest.py; imports from sibling modules
tests/conftest/fixtures.py
tests/conftest/setup.py
Alternative Solutions
I could create a different folder, like tests/lib/
, add code there, and import that code from tests/conftest.py
, but I'd prefer to keep the rest of the tests/
namespace free. For example, the way I organize my tests is identical to how I organize my code. If I have a source file lib/foo.py
, I'll create tests for it in tests/lib/test__foo.py
. If I used tests/lib/
to instead store setup code for the test suite, that would conflict with the above convention.