diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-06-30 15:20:31 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 15:20:31 (GMT) |
commit | 0e0bc8762570277147a09278c829e4a85a331596 (patch) | |
tree | 19c4a680191eab13742796715e7fa6539d8ede92 /Lib/test | |
parent | 714afccf6e7644d21ce1a39e90bf83cb0c9a74f1 (diff) | |
download | cpython-0e0bc8762570277147a09278c829e4a85a331596.zip cpython-0e0bc8762570277147a09278c829e4a85a331596.tar.gz cpython-0e0bc8762570277147a09278c829e4a85a331596.tar.bz2 |
bpo-30280: Cleanup threads in ayncio tests (#2501) (#2512)
* bpo-30280: asyncio now cleans up threads
asyncio base TestCase now uses threading_setup() and
threading_cleanup() of test.support to cleanup threads.
* asyncio: Fix TestBaseSelectorEventLoop cleanup
bpo-30280: TestBaseSelectorEventLoop of
test.test_asyncio.test_selector_events now correctly closes the event
loop: cleanup its executor to not leak threads.
Don't override the close() method of the event loop, only override
the_close_self_pipe() method.
(cherry picked from commit b9030674624c181d6e9047cdb14ad65bb6c84c66)
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_selector_events.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index 6bf7862..c50b3e4 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -24,16 +24,14 @@ MOCK_ANY = mock.ANY class TestBaseSelectorEventLoop(BaseSelectorEventLoop): - def close(self): - # Don't call the close() method of the parent class, because the - # selector is mocked - self._closed = True - def _make_self_pipe(self): self._ssock = mock.Mock() self._csock = mock.Mock() self._internal_fds += 1 + def _close_self_pipe(self): + pass + def list_to_buffer(l=()): return bytearray().join(l) |