Currently unitest.mock failed assertions are not recognized as "diffs" in PyCharm. This teaches the plugin to recognize those assertions and emit the EqualsAssertionError with the actual/expected.
Additionally:
pytest-mock (a popular pytest plugin providing the mocker fixture) has an improved reporting feature which patches unittest.mock and changes the format of the reports.
To work well out of the box, we handle both the stock and "patched" outputs.
For example, this test
def test_foo():
m = Mock()
m.foo(41)
m.foo.assert_called_once_with(42)
Currently
unitest.mock
failed assertions are not recognized as "diffs" in PyCharm. This teaches the plugin to recognize those assertions and emit theEqualsAssertionError
with the actual/expected.Additionally: pytest-mock (a popular pytest plugin providing the
mocker
fixture) has an improved reporting feature which patchesunittest.mock
and changes the format of the reports.To work well out of the box, we handle both the stock and "patched" outputs.
For example, this test
would result in this output: and diff viewer: