79717303

Date: 2025-07-28 12:23:36
Score: 1
Natty:
Report link

For anyone, still looking for a slim, elegant solution to this question in 2025. There is a method call_count in unittest.mock. So you can do a simple assert :

assert mock_function.call_count == 0

or

TestCase.assertEqual(mock_function.call_count, 0)

Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (1):
Posted by: optica_phoffmann