From e18a158bc9f603444a9c5f6f9bebcb7891ead889 Mon Sep 17 00:00:00 2001 From: Tea Aitch Date: Fri, 21 Mar 2025 11:48:59 +0100 Subject: [PATCH 1/3] Tests fixed that are not successful for specific plugins. For example for _hypothesis_pytestplugin. Fixes #12647 --- testing/test_helpconfig.py | 2 ++ testing/test_terminal.py | 1 + 2 files changed, 3 insertions(+) diff --git a/testing/test_helpconfig.py b/testing/test_helpconfig.py index 7fcf5804ace..dc7e709b65d 100644 --- a/testing/test_helpconfig.py +++ b/testing/test_helpconfig.py @@ -8,6 +8,7 @@ def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None: monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD") + monkeypatch.delenv("PYTEST_PLUGINS", raising=False) result = pytester.runpytest("--version", "--version") assert result.ret == 0 result.stdout.fnmatch_lines([f"*pytest*{pytest.__version__}*imported from*"]) @@ -17,6 +18,7 @@ def test_version_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None: def test_version_less_verbose(pytester: Pytester, pytestconfig, monkeypatch) -> None: monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD") + monkeypatch.delenv("PYTEST_PLUGINS", raising=False) result = pytester.runpytest("--version") assert result.ret == 0 result.stdout.fnmatch_lines([f"pytest {pytest.__version__}"]) diff --git a/testing/test_terminal.py b/testing/test_terminal.py index 42638f2edd7..86feb33b3ec 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -859,6 +859,7 @@ def test_header_trailer_info( self, monkeypatch: MonkeyPatch, pytester: Pytester, request ) -> None: monkeypatch.delenv("PYTEST_DISABLE_PLUGIN_AUTOLOAD") + monkeypatch.delenv("PYTEST_PLUGINS", raising=False) pytester.makepyfile( """ def test_passes(): From 57af4ae7f9820a0eddc0c1ffe5690cdc7009fdb1 Mon Sep 17 00:00:00 2001 From: Tea Aitch Date: Fri, 21 Mar 2025 16:59:34 +0100 Subject: [PATCH 2/3] Added changelog. --- changelog/12647.bugfix.rst | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog/12647.bugfix.rst diff --git a/changelog/12647.bugfix.rst b/changelog/12647.bugfix.rst new file mode 100644 index 00000000000..7744d754f10 --- /dev/null +++ b/changelog/12647.bugfix.rst @@ -0,0 +1 @@ +Fixes #12647. When using the _hypothesis_pytestplugin all tests are green. From 140a0aab5dc90dea584b7bc65cb697fef4c47f72 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Mon, 7 Apr 2025 15:01:04 -0300 Subject: [PATCH 3/3] Update and rename 12647.bugfix.rst to 12647.contrib.rst --- changelog/12647.bugfix.rst | 1 - changelog/12647.contrib.rst | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) delete mode 100644 changelog/12647.bugfix.rst create mode 100644 changelog/12647.contrib.rst diff --git a/changelog/12647.bugfix.rst b/changelog/12647.bugfix.rst deleted file mode 100644 index 7744d754f10..00000000000 --- a/changelog/12647.bugfix.rst +++ /dev/null @@ -1 +0,0 @@ -Fixes #12647. When using the _hypothesis_pytestplugin all tests are green. diff --git a/changelog/12647.contrib.rst b/changelog/12647.contrib.rst new file mode 100644 index 00000000000..1d7a3181778 --- /dev/null +++ b/changelog/12647.contrib.rst @@ -0,0 +1 @@ +Fixed running the test suite with the ``hypothesis`` pytest plugin.