This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Eli Rose
Recipients Eli Rose
Date 2016-09-09.22:44:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473461073.51.0.19108692382.issue28054@psf.upfronthosting.co.za>
In-reply-to
Content
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).
History
Date User Action Args
2016-09-09 22:44:33Eli Rosesetrecipients: + Eli Rose
2016-09-09 22:44:33Eli Rosesetmessageid: <1473461073.51.0.19108692382.issue28054@psf.upfronthosting.co.za>
2016-09-09 22:44:33Eli Roselinkissue28054 messages
2016-09-09 22:44:33Eli Rosecreate