From ba79c1926cf07a347d95d9fb6a7eeebebae1ef60 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Mon, 25 Mar 2013 08:53:08 +0100 Subject: [PATCH] add a test for issue 14 that will xfail on python < 2.7 --- testing/test_capture.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/testing/test_capture.py b/testing/test_capture.py index 06f976d68..8f40d1332 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -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("""