From de35402caed866ce3dd552bcc50a80f5385c8219 Mon Sep 17 00:00:00 2001 From: Ran Benita Date: Wed, 18 Jun 2025 11:27:51 +0300 Subject: [PATCH] Merge pull request #13481 from mgorny/pass-werror testing: Explicitly pass `-Werror` to tests needing it (cherry picked from commit 667398f53b7ca9a19a540054b03d505b84379114) --- changelog/13480.bugfix.rst | 1 + testing/test_threadexception.py | 2 +- testing/test_warnings.py | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelog/13480.bugfix.rst diff --git a/changelog/13480.bugfix.rst b/changelog/13480.bugfix.rst new file mode 100644 index 00000000000..ed649a33516 --- /dev/null +++ b/changelog/13480.bugfix.rst @@ -0,0 +1 @@ +Fixed a few test failures in pytest's own test suite when run with ``-Wdefault`` or a similar override. diff --git a/testing/test_threadexception.py b/testing/test_threadexception.py index 5dad07b8b85..f4595ec435d 100644 --- a/testing/test_threadexception.py +++ b/testing/test_threadexception.py @@ -211,7 +211,7 @@ def test_it(request): """ ) - result = pytester.runpytest() + result = pytester.runpytest("-Werror") # TODO: should be a test failure or error assert result.ret == pytest.ExitCode.INTERNAL_ERROR diff --git a/testing/test_warnings.py b/testing/test_warnings.py index c302e7c6e3c..b1c64dc9332 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -149,6 +149,7 @@ def test_func(fix): ) +@pytest.mark.skip("issue #13485") def test_works_with_filterwarnings(pytester: Pytester) -> None: """Ensure our warnings capture does not mess with pre-installed filters (#2430).""" pytester.makepyfile(