pytester and plugins using pytest_configure
#10583
Unanswered
The-Compiler
asked this question in
Q&A
Replies: 1 comment
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.
-
I'm using pytest-golden as well as pytester in the same project. pytest-golden happens to define a
pytest_configure
hook, which warns aboutenable_assertion_pass_hook
being unset, if that's the case.This is problematic in combination with pytester, because in the pytester run, the plugin gets loaded, but I'd rather not have to define a dummy .ini file to get rid of the warning. However, I don't actually use golden in those pytester tests... Here's a minimal example:
pytest.ini:
basic.yml:
test_golden.py:
This leads to:
How do I best deal with this? Is there something the pytest-golden plugin should change to make this easier? I've tried using
pytester.runpytest(plugins=["no:golden"])
, orpytester.runpytest("-p", "no:golden")
, but that doesn't seem to change anything for an inline run.Beta Was this translation helpful? Give feedback.
All reactions