From c142f2551dd3395326b441687596ae57a906a2d3 Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 22 Jan 2014 18:07:54 +0100 Subject: [PATCH] xfailing test for captire encoding issues with binary stdio --- testing/test_capture.py | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) 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*', + ]) +