diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 22:15:02 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-02-19 22:15:02 (GMT) |
| commit | 7ef60cd8c208d22672e76fcf031b4fa671a13684 (patch) | |
| tree | 450d12c31c3fe734566c85bcc0d04c4301a37836 /Lib/test/test_asyncio/test_base_events.py | |
| parent | f4558e8b54da0a7caf800c80589d934186b16f79 (diff) | |
| download | cpython-7ef60cd8c208d22672e76fcf031b4fa671a13684.zip cpython-7ef60cd8c208d22672e76fcf031b4fa671a13684.tar.gz cpython-7ef60cd8c208d22672e76fcf031b4fa671a13684.tar.bz2 | |
asyncio, Tulip issue #136: Add get/set_debug() methods to BaseEventLoopTests.
Add also a PYTHONASYNCIODEBUG environment variable to debug coroutines since
Python startup, to be able to debug coroutines defined directly in the asyncio
module.
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_base_events.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 2eee3be..784a39f 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -197,6 +197,12 @@ class BaseEventLoopTests(unittest.TestCase): self.assertEqual([h2], self.loop._scheduled) self.assertTrue(self.loop._process_events.called) + def test_set_debug(self): + self.loop.set_debug(True) + self.assertTrue(self.loop.get_debug()) + self.loop.set_debug(False) + self.assertFalse(self.loop.get_debug()) + @unittest.mock.patch('asyncio.base_events.time') @unittest.mock.patch('asyncio.base_events.logger') def test__run_once_logging(self, m_logger, m_time): |
