add a test for issue 14 that will xfail on python < 2.7

This commit is contained in:
Ronny Pfannschmidt 2013-03-25 08:53:08 +01:00
parent 76fb51a4ba
commit ba79c1926c
1 changed files with 12 additions and 0 deletions

View File

@ -437,6 +437,18 @@ class TestCaptureFixture:
])
assert result.ret == 2
@pytest.mark.xfail("sys.version_info < (2,7)")
@pytest.mark.issue14
def test_capture_and_logging(self, testdir):
p = testdir.makepyfile("""
import logging
def test_log(capsys):
logging.error('x')
""")
result = testdir.runpytest(p)
assert 'closed' not in result.stderr.str()
def test_setup_failure_does_not_kill_capturing(testdir):
sub1 = testdir.mkpydir("sub1")
sub1.join("conftest.py").write(py.code.Source("""