|
Hi! In devpi-server are several fixtures which are reused in plugin tests. That isn't optimal, see devpi/devpi#780. Some other fixtures are currently reused by importing them from After trying for some time I managed to get it working by using Problem is, it only works when using |
Replies: 1 comment 1 reply
|
Hi @fschulze I would avoid using another package's Instead of: pytest_plugins = [
"pytest_devpi_server",
"test_devpi_server.conftest",
]move the shared fixtures into a normal importable module, for example: and load that: pytest_plugins = [
"pytest_devpi_server",
"test_devpi_server.fixtures",
]Or, better still, expose those fixtures from the actual
Since your and compare whether the expected fixture names are actually registered and where pytest says they come from. The robust fix is nevertheless to move reusable fixtures out of Please mark this answer as accepted if it helped, thank you. |
Hi @fschulze
I would avoid using another package's
conftest.pyitself as the reusable plugin.Instead of:
move the shared fixtures into a normal importable module, for example:
and load that:
Or, better still, expose those fixtures from the actual
pytest_devpi_serverplugin if they belong to that plugin.conftest.pyhas 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…