Skip to content
Discussion options

You must be logged in to vote

Hi @fschulze

I would avoid using another package's conftest.py itself as the reusable plugin.

Instead of:

pytest_plugins = [
    "pytest_devpi_server",
    "test_devpi_server.conftest",
]

move the shared fixtures into a normal importable module, for example:

test_devpi_server/fixtures.py

and load that:

pytest_plugins = [
    "pytest_devpi_server",
    "test_devpi_server.fixtures",
]

Or, better still, expose those fixtures from the actual pytest_devpi_server plugin if they belong to that plugin.

conftest.py has special pytest discovery and directory-scoping semantics, so treating one as a reusable cross-package plugin makes behavior unnecessarily dependent on how the source tree is laid o…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@fschulze
Comment options

Answer selected by fschulze
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants