Can raise OSError for connection failure.

This commit is contained in:
Yuxin Wang 2019-10-21 23:30:51 -04:00 committed by GitHub
parent afcb89cdf2
commit 895121f097

View file

@ -19,7 +19,7 @@ def cleanup_files(files):
async def test_connect_refused(unused_tcp_port):
peer = Peer()
await peer.start(('localhost', 0))
with pytest.raises(ConnectionRefusedError):
with pytest.raises((ConnectionRefusedError, OSError)):
await peer.connect(('localhost', unused_tcp_port))