Replies: 1 comment
-
Pytester is unable to discover local plugins when testing in a tmpdir If the contest is not part of the collection tree it's simply never scanned by the nested pytest The recommended way to test packaged Plugins is to have a editable install and using the entry point |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello!
I'm trying to follow the example in https://docs.pytest.org/en/7.4.x/how-to/writing_plugins.html#testing-plugins, but I can't get it to work.
I have an empty
__init__.py
.I have a
conftest.py
containing:I have a
plugin.py
containing:And a
test_plugin.py
containing:(This is all exactly copy/pasted from the docs.)
Invoking
pytest test_plugin.py
leads to a bunch of captured stdout like:…which makes me think it isn't loading the plugin? And, okay, I haven't installed it, so it isn't registered as an entry point. But adding
pytester.plugins = ["plugin"]
doesn't make it work, despiteplugin
being importable.What am I doing wrong, and what do I need to do to make the example work preferably without making it installable?
Beta Was this translation helpful? Give feedback.
All reactions