diff options
author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:12:14 (GMT) |
---|---|---|
committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-22 22:12:14 (GMT) |
commit | 7b7120e159e2cb951b01773a164426c9e0bffa2d (patch) | |
tree | 39eaab2c2bdc14b365b734a17baf2ddb1f414627 /Lib/test | |
parent | d6de5d8455ac0d120d9c49d04f350433a86ec4e6 (diff) | |
download | cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.zip cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.tar.gz cpython-7b7120e159e2cb951b01773a164426c9e0bffa2d.tar.bz2 |
asyncio: Enable the debug mode of event loops when the PYTHONASYNCIODEBUG
environment variable is set
Diffstat (limited to 'Lib/test')
-rw-r--r-- | Lib/test/test_asyncio/test_selector_events.py | 2 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_subprocess.py | 4 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_tasks.py | 2 | ||||
-rw-r--r-- | Lib/test/test_asyncio/test_unix_events.py | 8 |
4 files changed, 4 insertions, 12 deletions
diff --git a/Lib/test/test_asyncio/test_selector_events.py b/Lib/test/test_asyncio/test_selector_events.py index 7c84f03..35efab9 100644 --- a/Lib/test/test_asyncio/test_selector_events.py +++ b/Lib/test/test_asyncio/test_selector_events.py @@ -682,8 +682,6 @@ class SelectorTransportTests(test_utils.TestCase): self.assertEqual(2, sys.getrefcount(self.protocol), pprint.pformat(gc.get_referrers(self.protocol))) self.assertIsNone(tr._loop) - self.assertEqual(3, sys.getrefcount(self.loop), - pprint.pformat(gc.get_referrers(self.loop))) class SelectorSocketTransportTests(test_utils.TestCase): diff --git a/Lib/test/test_asyncio/test_subprocess.py b/Lib/test/test_asyncio/test_subprocess.py index 3b962bf..3204d42 100644 --- a/Lib/test/test_asyncio/test_subprocess.py +++ b/Lib/test/test_asyncio/test_subprocess.py @@ -141,7 +141,7 @@ if sys.platform != 'win32': policy = asyncio.get_event_loop_policy() self.loop = policy.new_event_loop() - # ensure that the event loop is passed explicitly in the code + # ensure that the event loop is passed explicitly in asyncio policy.set_event_loop(None) watcher = self.Watcher() @@ -172,7 +172,7 @@ else: policy = asyncio.get_event_loop_policy() self.loop = asyncio.ProactorEventLoop() - # ensure that the event loop is passed explicitly in the code + # ensure that the event loop is passed explicitly in asyncio policy.set_event_loop(None) def tearDown(self): diff --git a/Lib/test/test_asyncio/test_tasks.py b/Lib/test/test_asyncio/test_tasks.py index e95c7dc..3c358a2 100644 --- a/Lib/test/test_asyncio/test_tasks.py +++ b/Lib/test/test_asyncio/test_tasks.py @@ -1712,6 +1712,8 @@ class CoroutineGatherTests(GatherTestsBase, test_utils.TestCase): self.assertIs(fut._loop, self.one_loop) gen1.close() gen2.close() + + self.set_event_loop(self.other_loop, cleanup=False) gen3 = coro() gen4 = coro() fut = asyncio.gather(gen3, gen4, loop=self.other_loop) diff --git a/Lib/test/test_asyncio/test_unix_events.py b/Lib/test/test_asyncio/test_unix_events.py index 89a4c10..0ade7f2 100644 --- a/Lib/test/test_asyncio/test_unix_events.py +++ b/Lib/test/test_asyncio/test_unix_events.py @@ -445,8 +445,6 @@ class UnixReadPipeTransportTests(test_utils.TestCase): self.assertEqual(2, sys.getrefcount(self.protocol), pprint.pformat(gc.get_referrers(self.protocol))) self.assertIsNone(tr._loop) - self.assertEqual(5, sys.getrefcount(self.loop), - pprint.pformat(gc.get_referrers(self.loop))) def test__call_connection_lost_with_err(self): tr = unix_events._UnixReadPipeTransport( @@ -462,8 +460,6 @@ class UnixReadPipeTransportTests(test_utils.TestCase): self.assertEqual(2, sys.getrefcount(self.protocol), pprint.pformat(gc.get_referrers(self.protocol))) self.assertIsNone(tr._loop) - self.assertEqual(5, sys.getrefcount(self.loop), - pprint.pformat(gc.get_referrers(self.loop))) class UnixWritePipeTransportTests(test_utils.TestCase): @@ -731,8 +727,6 @@ class UnixWritePipeTransportTests(test_utils.TestCase): self.assertEqual(2, sys.getrefcount(self.protocol), pprint.pformat(gc.get_referrers(self.protocol))) self.assertIsNone(tr._loop) - self.assertEqual(5, sys.getrefcount(self.loop), - pprint.pformat(gc.get_referrers(self.loop))) def test__call_connection_lost_with_err(self): tr = unix_events._UnixWritePipeTransport( @@ -747,8 +741,6 @@ class UnixWritePipeTransportTests(test_utils.TestCase): self.assertEqual(2, sys.getrefcount(self.protocol), pprint.pformat(gc.get_referrers(self.protocol))) self.assertIsNone(tr._loop) - self.assertEqual(5, sys.getrefcount(self.loop), - pprint.pformat(gc.get_referrers(self.loop))) def test_close(self): tr = unix_events._UnixWritePipeTransport( |