diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-17 23:36:32 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-17 23:36:32 (GMT) |
commit | c73701de7292b7de0fee5b7f82a610d7515c18a4 (patch) | |
tree | 18db9589cbd8880f4b1ac411bf675de788740e34 /Lib/test/test_asyncio/test_proactor_events.py | |
parent | d6f02fc649d2e248f2e7b418771371db2b6637a2 (diff) | |
download | cpython-c73701de7292b7de0fee5b7f82a610d7515c18a4.zip cpython-c73701de7292b7de0fee5b7f82a610d7515c18a4.tar.gz cpython-c73701de7292b7de0fee5b7f82a610d7515c18a4.tar.bz2 |
asyncio: Refactor tests: add a base TestCase class
Diffstat (limited to 'Lib/test/test_asyncio/test_proactor_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_proactor_events.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_proactor_events.py b/Lib/test/test_asyncio/test_proactor_events.py index 5bf24a4..ddfceae 100644 --- a/Lib/test/test_asyncio/test_proactor_events.py +++ b/Lib/test/test_asyncio/test_proactor_events.py @@ -12,10 +12,10 @@ from asyncio.proactor_events import _ProactorDuplexPipeTransport from asyncio import test_utils -class ProactorSocketTransportTests(unittest.TestCase): +class ProactorSocketTransportTests(test_utils.TestCase): def setUp(self): - self.loop = test_utils.TestLoop() + self.loop = self.new_test_loop() self.proactor = mock.Mock() self.loop._proactor = self.proactor self.protocol = test_utils.make_test_protocol(asyncio.Protocol) @@ -343,7 +343,7 @@ class ProactorSocketTransportTests(unittest.TestCase): tr.close() -class BaseProactorEventLoopTests(unittest.TestCase): +class BaseProactorEventLoopTests(test_utils.TestCase): def setUp(self): self.sock = mock.Mock(socket.socket) @@ -356,6 +356,7 @@ class BaseProactorEventLoopTests(unittest.TestCase): return (self.ssock, self.csock) self.loop = EventLoop(self.proactor) + self.set_event_loop(self.loop, cleanup=False) @mock.patch.object(BaseProactorEventLoop, 'call_soon') @mock.patch.object(BaseProactorEventLoop, '_socketpair') |