From eb639d19ece7e9560baacaa79c0f903f22c55bb2 Mon Sep 17 00:00:00 2001 From: holger krekel Date: Thu, 27 Mar 2014 11:57:36 +0100 Subject: [PATCH] properly extend tests to cover xfailing capturing modes --- testing/test_boxed.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/testing/test_boxed.py b/testing/test_boxed.py index 5b867fd..bee9367 100644 --- a/testing/test_boxed.py +++ b/testing/test_boxed.py @@ -18,7 +18,11 @@ def test_functional_boxed(testdir): ]) @needsfork -def test_functional_boxed_stdout(testdir): +@pytest.mark.parametrize("capmode", [ + "no", + pytest.mark.xfail("sys", reason="capture cleanup needed"), + pytest.mark.xfail("fd", reason="capture cleanup needed")]) +def test_functional_boxed_capturing(testdir, capmode): p1 = testdir.makepyfile(""" import os import sys @@ -27,7 +31,7 @@ def test_functional_boxed_stdout(testdir): sys.stderr.write("world\\n") os.kill(os.getpid(), 15) """) - result = testdir.runpytest(p1, "--boxed") + result = testdir.runpytest(p1, "--boxed", "--capture=%s" % capmode) result.stdout.fnmatch_lines(""" *CRASHED* *stdout*