Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed RuntimeWarning: coroutine PayloadWriter.write_eof was never awaited by making test_write_payload_eof a coroutine #2448

Closed
wants to merge 6 commits into from
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