Hi, and thanks for the report.
[... snipped ...] 2: if not self._mock_unsafe and (not self._mock_methods or name not in self._mock_methods): 2: if name.startswith(('assert', 'assret', 'asert', 'aseert', 'assrt')) or name in _ATTRIB_DENY_LIST: 2: > raise AttributeError( 2: f"{name!r} is not a valid assertion. Use a spec " 2: f"for the mock if {name!r} is meant to be an attribute.") 2: E AttributeError: 'called_with' is not a valid assertion. Use a spec for the mock if 'called_with' is meant to be an attribute.
It's caused by incorrect usage of mock.called_with and should actually be mock.assert_called_with, which was flagged in Python 3.12: https://github.com/python/cpython/issues/100690 @hroncok has started working on a patch here: https://github.com/Ultimaker/Cura/pull/16103 I'll try to pick this up and see if it fixes the issue on our side. Regards, Gregor