properly extend tests to cover xfailing capturing modes

This commit is contained in:
holger krekel
2014-03-27 11:57:36 +01:00
parent 4441002e95
commit eb639d19ec

View File

@@ -18,7 +18,11 @@ def test_functional_boxed(testdir):
]) ])
@needsfork @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(""" p1 = testdir.makepyfile("""
import os import os
import sys import sys
@@ -27,7 +31,7 @@ def test_functional_boxed_stdout(testdir):
sys.stderr.write("world\\n") sys.stderr.write("world\\n")
os.kill(os.getpid(), 15) os.kill(os.getpid(), 15)
""") """)
result = testdir.runpytest(p1, "--boxed") result = testdir.runpytest(p1, "--boxed", "--capture=%s" % capmode)
result.stdout.fnmatch_lines(""" result.stdout.fnmatch_lines("""
*CRASHED* *CRASHED*
*stdout* *stdout*