Saturday 9 January 2021

pytest mocker assert has_calls

 Managed to figure it out with the help of another answer provided by the author of pytest-mock.

The assert should be called as follows if using alt. A: mock_a.assert_has_calls([mocker.call(mocker.ANY, 100), mocker.call(mocker.ANY, 50)])

Posting this to help others.


from : https://stackoverflow.com/questions/59839192/python-pytest-mock-assert-has-calls

Tuesday 5 January 2021

Enable python debugger settings for Visual Studio Code

 Add python.pythonPath to settings.json as below:

{
"python.pythonPath": "/path/to/bin/python",
"debug.allowBreakpointsEverywhere": true,
"python.testing.nosetestPath": "nosetest",
"python.testing.cwd": "",
"python.testing.pytestEnabled": true
}