Skip to content

Commit 3e1971e

Browse files
authored
Merge pull request #4994 from blueyed/test_as_errors-subprocess
test_as_errors: use subprocess with `-W`
2 parents bcdb86e + 0ea1889 commit 3e1971e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

testing/test_warnings.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,12 @@ def test_as_errors(testdir, pyfile_with_warnings, method):
9595
testdir.makeini(
9696
"""
9797
[pytest]
98-
filterwarnings= error
98+
filterwarnings=error
9999
"""
100100
)
101-
result = testdir.runpytest(*args)
101+
# Use a subprocess, since changing logging level affects other threads
102+
# (xdist).
103+
result = testdir.runpytest_subprocess(*args)
102104
result.stdout.fnmatch_lines(
103105
[
104106
"E UserWarning: user warning",

0 commit comments

Comments
 (0)