Skip to content

Commit

Permalink
removed RuntimeWarning: coroutine PayloadWriter.write_eof was never a…
Browse files Browse the repository at this point in the history
…waited by making test_write_payload_eof a coroutine (aio-libs#2449)
  • Loading branch information
eteamin authored and asvetlov committed Oct 30, 2017
1 parent 8764562 commit 20362c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/test_http_writer.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@ def acquire(writer):
return stream


def test_write_payload_eof(stream, loop):
async def test_write_payload_eof(stream, loop):
write = stream.transport.write = mock.Mock()
msg = http.PayloadWriter(stream, loop)

msg.write(b'data1')
msg.write(b'data2')
msg.write_eof()
await msg.write_eof()

content = b''.join([c[1][0] for c in list(write.mock_calls)])
assert b'data1data2' == content.split(b'\r\n\r\n', 1)[-1]
Expand Down

0 comments on commit 20362c5

Please sign in to comment.