jenkins-bot has submitted this change. ( https://gerrit.wikimedia.org/r/c/pywikibot/core/+/743564 )
Change subject: [tests] Show a more informative message with failing test ......................................................................
[tests] Show a more informative message with failing test
TestTerminalOutput.test_exception_tb fails for Python 3.11. Show additional information about the reason.
Bug: T297044 Change-Id: I924498656d0e419d6548d7e44e32690d7bce0f37 --- M tests/ui_tests.py 1 file changed, 5 insertions(+), 1 deletion(-)
Approvals: Xqt: Looks good to me, approved jenkins-bot: Verified
diff --git a/tests/ui_tests.py b/tests/ui_tests.py index 2718610..fc7c75f 100644 --- a/tests/ui_tests.py +++ b/tests/ui_tests.py @@ -212,7 +212,11 @@ self.assertEqual(stderrlines[1], 'Traceback (most recent call last):') self.assertEqual(stderrlines[3], " raise TestExceptionError('Testing Exception')") - self.assertTrue(stderrlines[4].endswith(': Testing Exception')) + end_str = ': Testing Exception' + traceback_line = stderrlines[4] + self.assertTrue(traceback_line.endswith(end_str), + '\n{!r} does not end with {!r}' + .format(traceback_line, end_str))
self.assertNotEqual(stderrlines[-1], '\n')