diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2017-06-30 09:12:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-06-30 09:12:33 (GMT) |
commit | b9030674624c181d6e9047cdb14ad65bb6c84c66 (patch) | |
tree | 3f375fb837665a109a98450863f2b51a5fd71d39 /Lib/test | |
parent | 21a0a6c9f8a047b6eb173ee59e38ad5dc3c46f86 (diff) | |
download | cpython-b9030674624c181d6e9047cdb14ad65bb6c84c66.zip cpython-b9030674624c181d6e9047cdb14ad65bb6c84c66.tar.gz cpython-b9030674624c181d6e9047cdb14ad65bb6c84c66.tar.bz2 |
bpo-30280: Cleanup threads in ayncio tests (#2501)
* 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.
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) |