From 0ea18892657ec3adc61f0c3e02f7cc8c13b0f35c Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Sun, 24 Mar 2019 11:17:55 +0100 Subject: [PATCH] test_as_errors: use subprocess with `-W` Ref: https://github.com/pytest-dev/pytest/pull/4981 --- testing/test_warnings.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testing/test_warnings.py b/testing/test_warnings.py index 1b4231edc..929ae8d60 100644 --- a/testing/test_warnings.py +++ b/testing/test_warnings.py @@ -95,10 +95,12 @@ def test_as_errors(testdir, pyfile_with_warnings, method): testdir.makeini( """ [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( [ "E UserWarning: user warning",