Skip to content
Merged
Changes from 1 commit
Commits
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
Run patchcheck.py
  • Loading branch information
arhadthedev committed Apr 6, 2023
commit c9dd306e2de12f102c0100fa9f0ecaaf4e1172c6
8 changes: 4 additions & 4 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1815,7 +1815,7 @@ def run_test(self, func, jumpFrom, jumpTo, expected, error=None,
tracer = JumpTracer(func, jumpFrom, jumpTo, event, decorated)
sys.settrace(tracer.trace)
output = []

if warning is None and error is None:
Comment thread
serhiy-storchaka marked this conversation as resolved.
Outdated
func(output)
elif warning is not None and error is None:
Expand All @@ -1836,19 +1836,19 @@ def run_async_test(self, func, jumpFrom, jumpTo, expected, error=None,
tracer = JumpTracer(func, jumpFrom, jumpTo, event, decorated)
sys.settrace(tracer.trace)
output = []

if warning is None and error is None:
asyncio.run(func(output))
elif warning is not None and error is None:
with self.assertWarnsRegex(*warning):
asyncio.run(func(output))
asyncio.run(func(output))
elif warning is None and error is not None:
with self.assertRaisesRegex(*error):
asyncio.run(func(output))
else:
raise Exception("Not currently possible to assert both a warning and an exception in tandem, the former is seemingly ignored by the unittest framework")
assertTrue(False)

sys.settrace(None)
asyncio.set_event_loop_policy(None)
self.compare_jump_output(expected, output)
Expand Down