79481974

Date: 2025-03-03 19:39:12
Score: 1
Natty:
Report link

There's actually a more direct way to solve this, in case you have a lot of annoying arguments to fill.

mocked_method.assert_called_once()
args, kwargs = mocked_method.call_args

self.assertEqual(args[0], "your_positional_arg_value")
self.asssertEqual(kwargs.get("keyword_arg"), "your_keyword_arg_value")
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: Nicolas Johnson