Merge pull request #4994 from blueyed/test_as_errors-subprocess

test_as_errors: use subprocess with `-W`
This commit is contained in:
Bruno Oliveira 2019-03-25 20:50:15 -03:00 committed by GitHub
commit 3e1971eb16
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -95,10 +95,12 @@ def test_as_errors(testdir, pyfile_with_warnings, method):
testdir.makeini( testdir.makeini(
""" """
[pytest] [pytest]
filterwarnings= error filterwarnings=error
""" """
) )
result = testdir.runpytest(*args) # Use a subprocess, since changing logging level affects other threads
# (xdist).
result = testdir.runpytest_subprocess(*args)
result.stdout.fnmatch_lines( result.stdout.fnmatch_lines(
[ [
"E UserWarning: user warning", "E UserWarning: user warning",