The bug only affects 2.11.0. It doesn't occur on 2.10.3.
> python foo.py
bar
Traceback (most recent call last):
File "foo.py", line 9, in <module>
foo.assert_called_with()
File "/usr/lib/python3.8/unittest/mock.py", line 907, in assert_called_with
raise AssertionError(_error_message()) from cause
AssertionError: expected call not found.
Expected: mock()
Actual: mock(<Context {'range': <class 'range'>, 'dict': <class 'dict'>, 'lipsum': <function generate_lorem_ipsum at 0x7f8db9caa940>, 'cycler': <class 'jinja2.utils.Cycler'>, 'joiner': <class 'jinja2.utils.Joiner'>, 'namespace': <class 'jinja2.utils.Namespace'>, 'foo': <Mock id='140246696713376'>} of None>)
The bug only affects 2.11.0. It doesn't occur on 2.10.3.
Expected Behavior
Actual Behavior
Your Environment