Skip to content

Commit 50acf54

Browse files
committed
-
1 parent 03c93c3 commit 50acf54

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

tests/test_io.py

Lines changed: 10 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ async def test_background_socket(iopub_thread):
102102
sock.send(b"hi")
103103

104104

105-
async def test_outstream1(iopub_thread):
105+
@flaky(max_runs=3)
106+
async def test_outstream(iopub_thread):
106107
session = Session()
107108
pub = iopub_thread.socket
108109

@@ -116,21 +117,16 @@ async def test_outstream1(iopub_thread):
116117
stream = OutStream(session, iopub_thread, "stdout", watchfd=False)
117118
stream.close()
118119

119-
120-
@flaky(max_runs=3)
121-
async def test_outstream2(iopub_thread):
122-
session = Session()
123120
stream = OutStream(session, iopub_thread, "stdout", isatty=True, echo=io.StringIO())
124121

125-
with pytest.raises(io.UnsupportedOperation):
126-
stream.fileno()
127-
stream._watch_pipe_fd()
128-
stream.flush()
129-
stream.write("hi")
130-
stream.writelines(["ab", "cd"])
131-
assert stream.writable()
132-
133-
stream.close()
122+
with stream:
123+
with pytest.raises(io.UnsupportedOperation):
124+
stream.fileno()
125+
stream._watch_pipe_fd()
126+
stream.flush()
127+
stream.write("hi")
128+
stream.writelines(["ab", "cd"])
129+
assert stream.writable()
134130

135131

136132
async def test_event_pipe_gc(iopub_thread):

0 commit comments

Comments
 (0)