man-group / pytest-plugins

A grab-bag of nifty pytest plugins
MIT License
568 stars 85 forks source link

pytest-profiling: Fix mock in test_writes_summary #223

Closed s-t-e-v-e-n-k closed 3 weeks ago

s-t-e-v-e-n-k commented 7 months ago

In Python < 3.12, MagicMock's will blindly call any method provided to them, which is masking a real issue in this testcase. The correct method is assert_called_with(), and even worse, one of the arguments provided isn't correct either. Correct the method call, and provide the correct argument.