]> granicus.if.org Git - python/commit
bpo-37137: Fix test_asyncio: use TestCase.set_event_loop() (GH-13779)
authorVictor Stinner <vstinner@redhat.com>
Mon, 3 Jun 2019 15:49:04 +0000 (17:49 +0200)
committerGitHub <noreply@github.com>
Mon, 3 Jun 2019 15:49:04 +0000 (17:49 +0200)
commit49a7e347976c9b39149ac7505b11ad6e9e2bdeec
tree56469235e384349a7e0a7b2b3e9bd3d5de7cacc6
parent0b9956e9162d8723c2a30ff316ecc25e54459fb1
bpo-37137: Fix test_asyncio: use TestCase.set_event_loop() (GH-13779)

Replace asyncio.set_event_loop() with TestCase.set_event_loop() of
test_asyncio.utils: this method calls TestCase.close_loop() which
waits until the executor completes, to avoid leaking dangling
threads.

Inherit from test_asyncio.utils.TestCase rather than
unittest.TestCase.
Lib/test/test_asyncio/test_tasks.py