[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2018-12-10 Thread Chris Withers
Chris Withers added the comment: This is a tricky one as there's plenty of prior art, with pytest's assertion rewriting [1], testfixtures compare [2] and the stuff that unittest already does [3]. I don't think any solution should rely on a TestCase being used as pytest, which is the most

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2018-12-09 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: It seems that TestCase in unittest.case accepts failureException attribute that is raised on assertion failure. My initial approach is to subclass TestCase and add a custom failure exception like MockException that is caught to add the diff to the

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2018-11-10 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 for extending the unittest display niceties to mock. -- nosy: +rhettinger ___ Python tracker ___

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2018-11-10 Thread Karthikeyan Singaravelan
Karthikeyan Singaravelan added the comment: I think this can be useful for keyword arguments as in the original suggestion. I tried an initial implementation as below to use difflib to get the difference like unittest if there are keyword args to be checked against the caller list since the

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2016-10-25 Thread Michael Foord
Michael Foord added the comment: I like the idea and would be happy for it to be added to mock. -- ___ Python tracker ___

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2016-10-24 Thread Pavel Savchenko
Pavel Savchenko added the comment: An implementation of this exists in pytest-mock. Recently an idea was brought up to shift the development of PR #57 into mock directly for everyone's benefit. https://github.com/pytest-dev/pytest-mock

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2016-09-10 Thread SilentGhost
Changes by SilentGhost : -- nosy: +michael.foord versions: +Python 3.7 -Python 3.3 ___ Python tracker ___

[issue28054] Diff for visually comparing actual with expected in mock.assert_called_with.

2016-09-09 Thread Eli Rose
New submission from Eli Rose: 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',