summaryrefslogtreecommitdiff
path: root/Lib/unittest/test/test_case.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/unittest/test/test_case.py')
-rw-r--r--Lib/unittest/test/test_case.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/Lib/unittest/test/test_case.py b/Lib/unittest/test/test_case.py
index 00883c9bd2..1800f2e5df 100644
--- a/Lib/unittest/test/test_case.py
+++ b/Lib/unittest/test/test_case.py
@@ -841,6 +841,21 @@ test case
# so can't use assertEqual either. Just use assertTrue.
self.assertTrue(sample_text_error == error)
+ def testAsertEqualSingleLine(self):
+ sample_text = "laden swallows fly slowly"
+ revised_sample_text = "unladen swallows fly quickly"
+ sample_text_error = """\
+- laden swallows fly slowly
+? ^^^^
++ unladen swallows fly quickly
+? ++ ^^^^^
+"""
+ try:
+ self.assertEqual(sample_text, revised_sample_text)
+ except self.failureException as e:
+ error = str(e).split('\n', 1)[1]
+ self.assertTrue(sample_text_error == error)
+
def testAssertIsNone(self):
self.assertIsNone(None)
self.assertRaises(self.failureException, self.assertIsNone, False)