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():