Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Three tests fails with PYTEST_PLUGINS set to _hypothesis_pytestplugin #12647

Open
2 of 4 tasks
mtelka opened this issue Jul 22, 2024 · 0 comments
Open
2 of 4 tasks

Three tests fails with PYTEST_PLUGINS set to _hypothesis_pytestplugin #12647

mtelka opened this issue Jul 22, 2024 · 0 comments
Labels
type: selftests a problem in the tests of pytest

Comments

@mtelka
Copy link

mtelka commented Jul 22, 2024

  • a detailed description of the bug or problem you are having
  • output of pip list from the virtual environment you are using
  • pytest and operating system versions
  • minimal example if possible

I tried to run pytest tests in the main git branch with the following change in tox.ini:

diff --git a/tox.ini b/tox.ini
index 61563ca2c..bc08595c3 100644
--- a/tox.ini
+++ b/tox.ini
@@ -51,6 +51,8 @@ passenv =
     TERM
     SETUPTOOLS_SCM_PRETEND_VERSION_FOR_PYTEST
 setenv =
+    PYTEST_DISABLE_PLUGIN_AUTOLOAD=1
+    PYTEST_PLUGINS=_hypothesis_pytestplugin
     _PYTEST_TOX_DEFAULT_POSARGS={env:_PYTEST_TOX_POSARGS_DOCTESTING:} {env:_PYTEST_TOX_POSARGS_LSOF:} {env:_PYTEST_TOX_POSARGS_XDIST:}
 
     # See https://docs.python.org/3/library/io.html#io-encoding-warning

and I found that the following three tests failed:

=========================== short test summary info ============================
FAILED testing/test_helpconfig.py::test_version_verbose - assert <ExitCode.IN...
FAILED testing/test_helpconfig.py::test_version_less_verbose - assert <ExitCo...
FAILED testing/test_terminal.py::TestTerminalFunctional::test_header_trailer_info
XPASS testing/_py/test_local.py::TestLocalPath::test_make_numbered_dir_multiprocess_safe - #11603
= 3 failed, 3609 passed, 112 skipped, 11 xfailed, 1 xpassed in 312.55s (0:05:12) =

All three tests fails with the following error:

ValueError: Plugin already registered under a different name: _hypothesis_pytestplugin=<module '_hypothesis_pytestplugin' from '/data/builds/pytest/.tox/py39/lib/python3.9/site-packages/_hypothesis_pytestplugin.py'>

Probably (untested) we need to add monkeypatch.delenv("PYTEST_PLUGINS", raising=False) call to affected functions.

This seems to be related: #12616 (comment)

@mtelka mtelka changed the title Three tests fails with PYTEST_PLUGINS set Three tests fails with PYTEST_PLUGINS set to _hypothesis_pytestplugin Jul 22, 2024
@Zac-HD Zac-HD added the type: selftests a problem in the tests of pytest label Oct 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: selftests a problem in the tests of pytest
Projects
None yet
Development

No branches or pull requests

2 participants