We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent e7a11bd commit b43e3d9Copy full SHA for b43e3d9
tests/test_utils.py
@@ -119,11 +119,23 @@ def stdout_sim():
119
stdsim = cu.StdSim(sys.stdout)
120
return stdsim
121
122
+@pytest.fixture
123
+def stringio_sim():
124
+ import io
125
+ stdsim = cu.StdSim(io.StringIO(), echo=True)
126
+ return stdsim
127
+
128
129
def test_stdsim_write_str(stdout_sim):
130
my_str = 'Hello World'
131
stdout_sim.write(my_str)
132
assert stdout_sim.getvalue() == my_str
133
134
+def test_stdsim_write_str_inner_no_buffer(stringio_sim):
135
+ my_str = 'Hello World'
136
+ stringio_sim.write(my_str)
137
+ assert stringio_sim.getvalue() == my_str
138
139
def test_stdsim_write_bytes(stdout_sim):
140
b_str = b'Hello World'
141
with pytest.raises(TypeError):
0 commit comments