diff options
Diffstat (limited to 'Lib/unittest/test/test_case.py')
-rw-r--r-- | Lib/unittest/test/test_case.py | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py index c7ff3b0e3c..503ad2fb11 100644 --- a/Lib/unittest/test/test_case.py +++ b/Lib/unittest/test/test_case.py @@ -1103,12 +1103,9 @@ test case except self.failureException as e: # need to remove the first line of the error message error = str(e).split('\n', 1)[1] + self.assertEqual(sample_text_error, error) - # no fair testing ourself with ourself, and assertEqual is used for strings - # so can't use assertEqual either. Just use assertTrue. - self.assertTrue(sample_text_error == error) - - def testAsertEqualSingleLine(self): + def testAssertEqualSingleLine(self): sample_text = "laden swallows fly slowly" revised_sample_text = "unladen swallows fly quickly" sample_text_error = """\ @@ -1120,8 +1117,9 @@ test case try: self.assertEqual(sample_text, revised_sample_text) except self.failureException as e: + # need to remove the first line of the error message error = str(e).split('\n', 1)[1] - self.assertTrue(sample_text_error == error) + self.assertEqual(sample_text_error, error) def testAssertIsNone(self): self.assertIsNone(None) |