Message275481
When I call unittest.TestCase.assertEqual(a, b) on e.g. two unequal dictionaries, I get a nice diff pointing me to the differences.
>>> class A(unittest.TestCase):
... def test_foo(self):
... self.assertEqual(dict(foo='bar', zab='zar'), dict(foo='bar', zab='zab'))
>>> unittest.main()
======================================================================
FAIL: test_foo (__main__.A)
----------------------------------------------------------------------
Traceback (most recent call last):
File "<stdin>", line 3, in test_foo
AssertionError: {'foo': 'bar', 'zab': 'zar'} != {'foo': 'bar', 'zab': 'zab'}
- {'foo': 'bar', 'zab': 'zar'}
? ^
+ {'foo': 'bar', 'zab': 'zab'}
? ^
----------------------------------------------------------------------
Ran 1 test in 0.001s
FAILED (failures=1)
But when unittest.mock.Mock.assert_called_with fails, I don't get this nice diff output.
This would be very helpful in my present case (asserting that a function with many keyword arguments is called correctly). |
|
Date |
User |
Action |
Args |
2016-09-09 22:44:33 | Eli Rose | set | recipients:
+ Eli Rose |
2016-09-09 22:44:33 | Eli Rose | set | messageid: <1473461073.51.0.19108692382.issue28054@psf.upfronthosting.co.za> |
2016-09-09 22:44:33 | Eli Rose | link | issue28054 messages |
2016-09-09 22:44:33 | Eli Rose | create | |
|