(pytester: Pytester)
| 806 | |
| 807 | |
| 808 | def test_capture_binary_output(pytester: Pytester) -> None: |
| 809 | pytester.makepyfile( |
| 810 | r""" |
| 811 | import pytest |
| 812 | |
| 813 | def test_a(): |
| 814 | import sys |
| 815 | import subprocess |
| 816 | subprocess.call([sys.executable, __file__]) |
| 817 | |
| 818 | def test_foo(): |
| 819 | import os;os.write(1, b'\xc3') |
| 820 | |
| 821 | if __name__ == '__main__': |
| 822 | test_foo() |
| 823 | """ |
| 824 | ) |
| 825 | result = pytester.runpytest("--assert=plain") |
| 826 | result.assert_outcomes(passed=2) |
| 827 | |
| 828 | |
| 829 | def test_error_during_readouterr(pytester: Pytester) -> None: |
nothing calls this directly
no test coverage detected