diff --git a/testing/test_capture.py b/testing/test_capture.py index edba3fcb3..cd1f2d865 100644 --- a/testing/test_capture.py +++ b/testing/test_capture.py @@ -493,3 +493,26 @@ def test_capture_early_option_parsing(testdir): result = testdir.runpytest("-vs") assert result.ret == 0 assert 'hello19' in result.stdout.str() + +@pytest.mark.xfail(sys.version_info >= (3, 0), reason='encoding issues') +def test_capture_binary_output(testdir): + testdir.makepyfile(""" + import pytest + + def test_a(): + import sys + import subprocess + subprocess.call([sys.executable, __file__]) + + @pytest.mark.skip + def test_foo(): + import os;os.write(1, b'\xc3') + + if __name__ == '__main__': + test_foo() + """) + result = testdir.runpytest('--assert=plain') + result.stdout.fnmatch_lines([ + '*2 passed*', + ]) +