Move Capture classes from compat to capture and improve naming

Move {Passthrough,CaptureIO} to capture module, and rename Passthrough
-> Tee to match the existing terminology.

Co-authored-by: Ran Benita <ran@unusedvar.com>
This commit is contained in:
Daniel Hahler
2020-02-04 09:49:11 +01:00
committed by Ran Benita
parent 80e5098408
commit 7647d1c836
3 changed files with 24 additions and 27 deletions
+3 -3
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")