diff options
| author | Victor Stinner <victor.stinner@gmail.com> | 2014-06-27 11:55:28 (GMT) |
|---|---|---|
| committer | Victor Stinner <victor.stinner@gmail.com> | 2014-06-27 11:55:28 (GMT) |
| commit | eb39199f3def654b502bc8362d241bcbcc2891c7 (patch) | |
| tree | a6a8f6a1645b130c8d725ed8e804d4e3640e9b44 /Lib/test/test_asyncio/test_base_events.py | |
| parent | fe4a979099300e502eff8a1fd6f6d6a596771dda (diff) | |
| parent | 80f53aa9a0b2af28c9d8052c46b452cccb8e0b41 (diff) | |
| download | cpython-eb39199f3def654b502bc8362d241bcbcc2891c7.zip cpython-eb39199f3def654b502bc8362d241bcbcc2891c7.tar.gz cpython-eb39199f3def654b502bc8362d241bcbcc2891c7.tar.bz2 | |
(Merge 3.4) asyncio, Tulip issue 137: In debug mode, save traceback where
Future, Task and Handle objects are created. Pass the traceback to
call_exception_handler() in the 'source_traceback' key.
The traceback is truncated to hide internal calls in asyncio, show only the
traceback from user code.
Add tests for the new source_traceback, and a test for the 'Future/Task
exception was never retrieved' log.
Diffstat (limited to 'Lib/test/test_asyncio/test_base_events.py')
| -rw-r--r-- | Lib/test/test_asyncio/test_base_events.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Lib/test/test_asyncio/test_base_events.py b/Lib/test/test_asyncio/test_base_events.py index 6ad0804..adba082 100644 --- a/Lib/test/test_asyncio/test_base_events.py +++ b/Lib/test/test_asyncio/test_base_events.py @@ -406,19 +406,22 @@ class BaseEventLoopTests(test_utils.TestCase): 1/0 def run_loop(): - self.loop.call_soon(zero_error) + handle = self.loop.call_soon(zero_error) self.loop._run_once() + return handle + self.loop.set_debug(True) self.loop._process_events = mock.Mock() mock_handler = mock.Mock() self.loop.set_exception_handler(mock_handler) - run_loop() + handle = run_loop() mock_handler.assert_called_with(self.loop, { 'exception': MOCK_ANY, 'message': test_utils.MockPattern( 'Exception in callback.*zero_error'), - 'handle': MOCK_ANY, + 'handle': handle, + 'source_traceback': handle._source_traceback, }) mock_handler.reset_mock() |
