Skip to content

Commit fd2495c

Browse files
Fix test suite when PYTEST_PLUGINS is set (#13361)
Fixes #12647 (cherry picked from commit 0286f64) Co-authored-by: TobiMcNamobi <[email protected]>
1 parent 26af494 commit fd2495c

File tree

3 files changed

+4
-0
lines changed

3 files changed

+4
-0
lines changed

changelog/12647.contrib.rst

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fixed running the test suite with the ``hypothesis`` pytest plugin.

testing/test_helpconfig.py

+2
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88

99
def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
1010
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
11+
monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
1112
result = pytester.runpytest("--version", "--version")
1213
assert result.ret == 0
1314
result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"])
@@ -17,6 +18,7 @@ def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
1718

1819
def test_version_less_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None:
1920
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
21+
monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
2022
result = pytester.runpytest("--version")
2123
assert result.ret == 0
2224
result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"])

testing/test_terminal.py

+1
Original file line numberDiff line numberDiff line change
@@ -859,6 +859,7 @@ def test_header_trailer_info(
859859
self, monkeypatch: MonkeyPatch, pytester: Pytester, request
860860
) -> None:
861861
monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD")
862+
monkeypatch.delenv("PYTEST_PLUGINS", raising=False)
862863
pytester.makepyfile(
863864
"""
864865
def test_passes():

0 commit comments

Comments
 (0)