◐ Shell
clean mode source ↗

Issue 22756: testAssertEqualSingleLine gives poor errors

found while backporting unittest fixes.

The current test fails like so:
======================================================================
FAIL: testAssertEqualSingleLine (unittest2.test.test_case.Test_TestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/robertc/work/unittest2.hg/unittest2/test/test_case.py", line 1014, in testAssertEqualSingleLine
    self.assertEqual(sample_text, revised_sample_text)
AssertionError: 'laden swallows fly slowly' != 'unladen swallows fly quickly'
- laden swallows fly slowly?                    ^^^^
+ unladen swallows fly quickly? ++                   ^^^^^


During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/robertc/work/unittest2.hg/unittest2/test/test_case.py", line 1017, in testAssertEqualSingleLine
    self.assertTrue(sample_text_error == error)
AssertionError: False is not true


-> it shouldn't be using assertTrue.