Skip to content

Commit 0ea1889

Browse files
committed
test_as_errors: use subprocess with -W
Ref: #4981
1 parent b3319a6 commit 0ea1889

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)