summaryrefslogtreecommitdiffstats
path: root/Lib/test
diff options
context:
space:
mode:
authorJames <morisja@gmail.com>2023-10-18 07:36:16 (GMT)
committerGitHub <noreply@github.com>2023-10-18 07:36:16 (GMT)
commit77dbd956090aac66e264d9d640f6adb6b0930b87 (patch)
tree29d66940586b49c487ed31c5d7177d2904b7d970 /Lib/test
parent738574fb21967a1f313f1542dd7b70ae0dcd9705 (diff)
downloadcpython-77dbd956090aac66e264d9d640f6adb6b0930b87.zip
cpython-77dbd956090aac66e264d9d640f6adb6b0930b87.tar.gz
cpython-77dbd956090aac66e264d9d640f6adb6b0930b87.tar.bz2
gh-111019: Align expected and actual titles in test output (#111020)
Align expected and actual titles in output from assert_has_calls/assert_called_with for greater readability
Diffstat (limited to 'Lib/test')
-rw-r--r--Lib/test/test_unittest/testmock/testmock.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/Lib/test/test_unittest/testmock/testmock.py b/Lib/test/test_unittest/testmock/testmock.py
index d23eb87..6af8acc 100644
--- a/Lib/test/test_unittest/testmock/testmock.py
+++ b/Lib/test/test_unittest/testmock/testmock.py
@@ -1058,7 +1058,7 @@ class MockTest(unittest.TestCase):
actual = 'not called.'
expected = "mock(1, '2', 3, bar='foo')"
- message = 'expected call not found.\nExpected: %s\nActual: %s'
+ message = 'expected call not found.\nExpected: %s\n Actual: %s'
self.assertRaisesWithMsg(
AssertionError, message % (expected, actual),
mock.assert_called_with, 1, '2', 3, bar='foo'
@@ -1073,7 +1073,7 @@ class MockTest(unittest.TestCase):
for meth in asserters:
actual = "foo(1, '2', 3, foo='foo')"
expected = "foo(1, '2', 3, bar='foo')"
- message = 'expected call not found.\nExpected: %s\nActual: %s'
+ message = 'expected call not found.\nExpected: %s\n Actual: %s'
self.assertRaisesWithMsg(
AssertionError, message % (expected, actual),
meth, 1, '2', 3, bar='foo'
@@ -1083,7 +1083,7 @@ class MockTest(unittest.TestCase):
for meth in asserters:
actual = "foo(1, '2', 3, foo='foo')"
expected = "foo(bar='foo')"
- message = 'expected call not found.\nExpected: %s\nActual: %s'
+ message = 'expected call not found.\nExpected: %s\n Actual: %s'
self.assertRaisesWithMsg(
AssertionError, message % (expected, actual),
meth, bar='foo'
@@ -1093,7 +1093,7 @@ class MockTest(unittest.TestCase):
for meth in asserters:
actual = "foo(1, '2', 3, foo='foo')"
expected = "foo(1, 2, 3)"
- message = 'expected call not found.\nExpected: %s\nActual: %s'
+ message = 'expected call not found.\nExpected: %s\n Actual: %s'
self.assertRaisesWithMsg(
AssertionError, message % (expected, actual),
meth, 1, 2, 3
@@ -1103,7 +1103,7 @@ class MockTest(unittest.TestCase):
for meth in asserters:
actual = "foo(1, '2', 3, foo='foo')"
expected = "foo()"
- message = 'expected call not found.\nExpected: %s\nActual: %s'
+ message = 'expected call not found.\nExpected: %s\n Actual: %s'
self.assertRaisesWithMsg(
AssertionError, message % (expected, actual), meth
)
@@ -1552,7 +1552,7 @@ class MockTest(unittest.TestCase):
'^{}$'.format(
re.escape('Calls not found.\n'
'Expected: [call()]\n'
- 'Actual: [call(1)]'))) as cm:
+ ' Actual: [call(1)]'))) as cm:
mock.assert_has_calls([call()])
self.assertIsNone(cm.exception.__cause__)
@@ -1564,7 +1564,7 @@ class MockTest(unittest.TestCase):
'Error processing expected calls.\n'
"Errors: [None, TypeError('too many positional arguments')]\n"
"Expected: [call(), call(1, 2)]\n"
- 'Actual: [call(1)]'))) as cm:
+ ' Actual: [call(1)]'))) as cm:
mock.assert_has_calls([call(), call(1, 2)])
self.assertIsInstance(cm.exception.__cause__, TypeError)