Skip to content

Commit

Permalink
Improve wording and error type for failure edge case
Browse files Browse the repository at this point in the history
  • Loading branch information
TabLand committed Sep 3, 2023
1 parent 73d5589 commit 8c88dce
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Lib/test/test_sys_settrace.py
Original file line number Diff line number Diff line change
Expand Up @@ -1949,8 +1949,7 @@ def run_test(self, func, jumpFrom, jumpTo, expected, error=None,
with self.assertRaisesRegex(*error):
func(output)
else:
raise Exception("Not currently possible to assert both a warning and an error in tandem, the former is seemingly ignored by the unittest framework")
assertTrue(False)
raise NotImplementedError("Not currently possible to assert both a warning and an error in tandem, as one will be ignored by the unittest framework")

sys.settrace(None)
self.compare_jump_output(expected, output)
Expand All @@ -1970,8 +1969,7 @@ def run_async_test(self, func, jumpFrom, jumpTo, expected, error=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)
raise NotImplementedError("Not currently possible to assert both a warning and an error in tandem, as one will be ignored by the unittest framework")

sys.settrace(None)
asyncio.set_event_loop_policy(None)
Expand Down

0 comments on commit 8c88dce

Please sign in to comment.