Merge pull request #6765 from blueyed/capture-refactor-1

Refactor Capture classes: move/rename CaptureIO classes
This commit is contained in:
Ran Benita
2020-05-05 21:46:18 +03:00
committed by GitHub
3 changed files with 24 additions and 27 deletions

View File

@@ -804,10 +804,10 @@ class TestCaptureIO:
assert f.getvalue() == "foo\r\n"
class TestCaptureAndPassthroughIO(TestCaptureIO):
class TestTeeCaptureIO(TestCaptureIO):
def test_text(self):
sio = io.StringIO()
f = capture.CaptureAndPassthroughIO(sio)
f = capture.TeeCaptureIO(sio)
f.write("hello")
s1 = f.getvalue()
assert s1 == "hello"
@@ -818,7 +818,7 @@ class TestCaptureAndPassthroughIO(TestCaptureIO):
def test_unicode_and_str_mixture(self):
sio = io.StringIO()
f = capture.CaptureAndPassthroughIO(sio)
f = capture.TeeCaptureIO(sio)
f.write("\u00f6")
pytest.raises(TypeError, f.write, b"hello")