Exemplo n.º 1
0
 def test_text(self):
     sio = io.StringIO()
     f = capture.TeeCaptureIO(sio)
     f.write("hello")
     s1 = f.getvalue()
     assert s1 == "hello"
     s2 = sio.getvalue()
     assert s2 == s1
     f.close()
     sio.close()
Exemplo n.º 2
0
 def test_unicode_and_str_mixture(self):
     sio = io.StringIO()
     f = capture.TeeCaptureIO(sio)
     f.write("\u00f6")
     pytest.raises(TypeError, f.write, b"hello")