Skip to content

Commit 9240a50

Browse files
committed
testing: Explicitly pass -Werror to tests needing it
Explicitly pass `-Werror` to `runpytester()` in the few additional tests needing it, in order to fix test failures when the test suite is run with `-Wdefault` or a similar override. Fixes #13480
1 parent 80dfa2d commit 9240a50

4 files changed

Lines changed: 6 additions & 3 deletions

File tree

changelog/13480.bugfix.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Modified a few self-tests to explicitly pass ``-Werror``
2+
to ``runpytester()``, in order to fix test failures when the test suite
3+
is run with ``-Wdefault`` or a similar override.

testing/test_threadexception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ def test_it(request):
211211
"""
212212
)
213213

214-
result = pytester.runpytest()
214+
result = pytester.runpytest("-Werror")
215215

216216
# TODO: should be a test failure or error
217217
assert result.ret == pytest.ExitCode.INTERNAL_ERROR

testing/test_unraisableexception.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def test_it():
257257
)
258258

259259
with _disable_gc():
260-
result = pytester.runpytest()
260+
result = pytester.runpytest("-Werror")
261261

262262
# TODO: should be a test failure or error
263263
assert result.ret == pytest.ExitCode.INTERNAL_ERROR

testing/test_warnings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ def test_my_warning(self):
169169
assert True
170170
"""
171171
)
172-
result = pytester.runpytest()
172+
result = pytester.runpytest("-Werror")
173173
result.stdout.fnmatch_lines(["*== 1 passed in *"])
174174

175175

0 commit comments

Comments
 (0)