From b18040337a0cc9c26b0eefe6c0ac115b9a7a5dbe Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Thu, 27 Mar 2014 13:53:59 +0100 Subject: [PATCH] xfailing test for issue 412 --- .hgignore | 2 ++ testing/test_capture.py | 18 ++++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/.hgignore b/.hgignore index 2be7f81c9..398044a1a 100644 --- a/.hgignore +++ b/.hgignore @@ -9,6 +9,7 @@ lib/ bin/ include/ .Python/ +.env/ # These lines are suggested according to the svn:ignore property # Feel free to enable them by uncommenting them @@ -27,6 +28,7 @@ dist/ *.egg-info issue/ env/ +env3/ 3rdparty/ .tox .cache diff --git a/testing/test_capture.py b/testing/test_capture.py index e3fe6cfcf..058c81436 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -533,6 +533,24 @@ def test_capture_conftest_runtest_setup(testdir): assert 'hello19' not in result.stdout.str() +@pytest.mark.xfail(reason='demonstrate #412') +def test_capture_badoutput(testdir): + testdir.makepyfile(""" + import os + + def test_func(): + omg = bytearray([1,129,1]) + os.write(1, omg) + assert 0 + """) + result = testdir.runpytest('--cap=fd') + #this fails on python3 - fnmatch first for debugging + result.stdout.fnmatch_lines([ + '*1 failed*', + ]) + assert result.ret == 1 + + def test_capture_early_option_parsing(testdir): testdir.makeconftest(""" def pytest_runtest_setup():