diff --git a/changelog/13480.bugfix.rst b/changelog/13480.bugfix.rst new file mode 100644 index 00000000000..72bc20b0d73 --- /dev/null +++ b/changelog/13480.bugfix.rst @@ -0,0 +1,3 @@ +Modified a few self-tests to explicitly pass ``-Werror`` +to ``runpytester()``, in order to fix test failures when the test suite +is 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_unraisableexception.py b/testing/test_unraisableexception.py index 6c0dc542e93..15a8d47e1a2 100644 --- a/testing/test_unraisableexception.py +++ b/testing/test_unraisableexception.py @@ -257,7 +257,7 @@ def test_it(): ) with _disable_gc(): - 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(