Use pytest-mocker
so you don’t need to run a function in your code during testing.
For example, a function which writes to disk.
Use a mocker
to skip over this function in the test.
Note, it is important to know where to mock. This must be where the function is called, which is not necessarily where it is defined.