You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
deftest_send_changelog_event(self, *, man, table, key, current_event): man.send_changelog_event(key, 3, "value")
> assert man.storage.__setitem__.called_once_with(key, "value")
tests/unit/tables/test_objects.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Mock name='mock.__setitem__' id='140414725685024'>, name = 'called_once_with'
def__getattr__(self, name):
if name in {'_mock_methods', '_mock_unsafe'}:
raiseAttributeError(name)
elifself._mock_methods isnotNone:
if name notinself._mock_methods or name in _all_magics: raiseAttributeError("Mock object has no attribute %r"% name) elif _is_magic(name):
raiseAttributeError(name)
ifnotself._mock_unsafe and (notself._mock_methods or name notinself._mock_methods): if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in_ATTRIB_DENY_LIST: >raiseAttributeError(
f"{name!r} is not a valid assertion. Use a spec "f"for the mock if {name!r} is meant to be an attribute.") E AttributeError: 'called_once_with'isnot a valid assertion. Use a spec for the mock if'called_once_with'is meant to be an attribute.. Did you mean: 'assert_called_once_with'?
After renaming the method with assert_ :
tests/unit/tables/test_objects.py:66:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _../../.asdf/installs/python/3.12.0/lib/python3.12/unittest/mock.py:956: in assert_called_once_with return self.assert_called_with(*args, **kwargs)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <Mock name='mock.__setitem__' id='140667361335760'>, args = (<Mock name='key' id='140667361334032'>, 'value'), kwargs = {} expected = call(<Mock name='key' id='140667361334032'>, 'value')
actual = call(<Mock name='key' id='140667361334032'>, "<Mock name='key' id='140667361334032'>-stored") _error_message = <function NonCallableMock.assert_called_with.<locals>._error_message at 0x7fefab84da80>, cause = None def assert_called_with(self, /, *args, **kwargs):
"""assert that the last call was made with the specified arguments.
Raises an AssertionErrorif the args and keyword args passed in are different to the last call to the mock."""ifself.call_args isNone: expected =self._format_mock_call_signature(args, kwargs)
actual ='not called.'
error_message = ('expected call not found.\nExpected: %s\nActual: %s'% (expected, actual))
raiseAssertionError(error_message)
def_error_message():
msg =self._format_mock_failure_message(args, kwargs)
return msg
expected =self._call_matcher(_Call((args, kwargs), two=True))
actual =self._call_matcher(self.call_args)
if actual != expected:
cause = expected ifisinstance(expected, Exception) elseNone
> raise AssertionError(_error_message()) from cause
E AssertionError: expected call not found.
E Expected: mock(<Mock name='key' id='140667361334032'>, 'value')
E Actual: mock(<Mock name='key' id='140667361334032'>, "<Mock name='key' id='140667361334032'>-stored")
Versions
Python version
3.12
Faust version
Master
Operating system
Linux
The text was updated successfully, but these errors were encountered:
Checklist
master
branch of Faust.Steps to reproduce
Try and test with 3.12
Expected behavior
Green tests
Actual behavior
See tracebacks below
Probably related, though the fix doesn't help: miguelgrinberg/python-socketio#1265
Full traceback
After renaming the method with
assert_
:Versions
3.12
Master
Linux
The text was updated successfully, but these errors were encountered: