Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
15a9cfe
bpo-45924: Fix asyncio incorrect traceback when future's exception is…
kumaraditya303 Dec 27, 2021
4e5accf
Update Lib/test/test_asyncio/test_futures2.py
asvetlov Feb 15, 2022
42600eb
Update test_futures2.py
asvetlov Feb 15, 2022
d792cc4
Fix test
asvetlov Feb 15, 2022
858fcaf
Fix altered execution error
asvetlov Feb 15, 2022
c192f03
Fix line numbers
asvetlov Feb 15, 2022
72e23ef
Make test more robust
asvetlov Feb 15, 2022
94d0ef9
Merge branch 'main' into issue45924
asvetlov Feb 15, 2022
10b1125
Fix docs
asvetlov Feb 15, 2022
02955ae
Cleanup
asvetlov Feb 15, 2022
842c78f
Merge branch 'main' into issue45924
asvetlov Feb 15, 2022
f501ce1
Merge branch 'main' of https://github.com/python/cpython into issue45924
kumaraditya303 Feb 26, 2022
3a81ce8
fix it with IsolatedAsyncioTestCase
kumaraditya303 Feb 28, 2022
7b55533
Merge branch 'main' of https://github.com/python/cpython into issue45924
kumaraditya303 Mar 10, 2022
63b6fc1
revert
kumaraditya303 Mar 21, 2022
d04e79c
Merge branch 'main' of https://github.com/python/cpython into issue45924
kumaraditya303 Mar 21, 2022
e437cd8
Update Modules/_asynciomodule.c
kumaraditya303 Mar 21, 2022
3312f53
Merge branch 'main' into issue45924
kumaraditya303 Apr 17, 2022
3a671d2
Merge branch 'main' into issue45924
kumaraditya303 Apr 19, 2022
9c9f0e6
Merge branch 'main' into issue45924
kumaraditya303 Apr 28, 2022
9c8577c
Merge branch 'main' of https://github.com/python/cpython into issue45924
kumaraditya303 May 4, 2022
79c8929
Merge branch 'main' into issue45924
kumaraditya303 May 27, 2022
827d57b
Merge branch 'main' into issue45924
kumaraditya303 Jun 30, 2022
07f5000
finally working!
kumaraditya303 Jun 30, 2022
a433abc
rename var
kumaraditya303 Jul 1, 2022
004f64e
Merge branch 'main' into issue45924
kumaraditya303 Jul 6, 2022
9d6bae0
test both implementations
kumaraditya303 Jul 9, 2022
998f33f
separate tests
kumaraditya303 Jul 10, 2022
bf757ce
Update Lib/test/test_asyncio/test_futures2.py
kumaraditya303 Jul 11, 2022
0eb9594
Update Lib/test/test_asyncio/test_futures2.py
kumaraditya303 Jul 11, 2022
c9a6fe7
fix indent
kumaraditya303 Jul 11, 2022
88b819b
Merge branch 'main' into issue45924
iritkatriel Jul 11, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix test
  • Loading branch information
asvetlov committed Feb 15, 2022
commit d792cc4ed47d1995ea4cc02be299f2e3a9f2b875
39 changes: 22 additions & 17 deletions Lib/test/test_asyncio/test_futures2.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,37 @@
import unittest
import traceback

from textwrap import dedent


class FutureTests(unittest.IsolatedAsyncioTestCase):
async def test_future_traceback(self):
maxDiff = None
Comment thread
kumaraditya303 marked this conversation as resolved.
Outdated

Comment thread
kumaraditya303 marked this conversation as resolved.
async def test_future_traceback(self):
Comment thread
kumaraditya303 marked this conversation as resolved.

async def raise_exc():
raise TypeError(42)

future = asyncio.create_task(raise_exc())
for _ in range(10):
try:
await future
except TypeError:
Comment thread
asvetlov marked this conversation as resolved.
Outdated
tb = traceback.format_exc()
expected = (
f"""Traceback (most recent call last):
File "{__file__}", line 13, in test_future_traceback
await future
^^^^^^^^^^^^
File "{__file__}", line 9, in raise_exc
raise TypeError(42)
^^^^^^^^^^^^^^^^^^^
TypeError: 42
"""
)
self.assertEqual(tb, expected)
else:
self.fail('TypeError not raised')


expected = dedent(f"""\
Traceback (most recent call last):
File "{__file__}", line 20, in test_future_traceback
await future
^^^^^^^^^^^^
File "{__file__}", line 15, in raise_exc
raise TypeError(42)
^^^^^^^^^^^^^^^^^^^
TypeError: 42
""")
self.assertEqual(tb, expected)
else:
self.fail('TypeError not raised')

async def test_recursive_repr_for_pending_tasks(self):
Comment thread
kumaraditya303 marked this conversation as resolved.
# The call crashes if the guard for recursive call
# in base_futures:_future_repr_info is absent
Expand Down