8000 [3.6] bpo-37228: Fix warnings in test_asyncio.test_base_events (GH-17577) by miss-islington · Pull Request #17581 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

[3.6] bpo-37228: Fix warnings in test_asyncio.test_base_events (GH-17577) #17581

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

Merged
merged 1 commit into from
Dec 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Fix warnings in test_asyncio.test_base_events (GH-17577)
Co-authored-by: tirkarthi
(cherry picked from commit 1988344)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
  • Loading branch information
aeros authored and miss-islington committed Dec 12, 2019
commit 0230f476c7688ade96bcaf38824c8e9540ea18e7
7 changes: 4 additions & 3 deletions Lib/test/test_asyncio/test_base_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -1708,7 +1708,10 @@ def test_create_datagram_endpoint_reuse_address_warning(self):
reuse_address=False)

with self.assertWarns(DeprecationWarning):
self.loop.run_until_complete(coro)
transport, protocol = self.loop.run_until_complete(coro)
transport.close()
self.loop.run_until_complete(protocol.done)
self.assertEqual('CLOSED', protocol.state)

@patch_socket
def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
Expand All @@ -1718,7 +1721,6 @@ def test_create_datagram_endpoint_nosoreuseport(self, m_socket):
coro = self.loop.create_datagram_endpoint(
lambda: MyDatagramProto(loop=self.loop),
local_addr=('127.0.0.1', 0),
reuse_address=False,
reuse_port=True)

self.assertRaises(ValueError, self.loop.run_until_complete, coro)
Expand All @@ -1737,7 +1739,6 @@ def getaddrinfo(*args, **kw):
coro = self.loop.create_datagram_endpoint(
lambda: MyDatagramProto(loop=self.loop),
local_addr=('1.2.3.4', 0),
reuse_address=False,
reuse_port=reuseport_supported)

t, p = self.loop.run_until_complete(coro)
Expand Down
0