When doing unit-testing with Python / PyTest, if you do you not have patch decorators or with patch
blocks throughout your code, is there a way to reset all mocks at the end of every file / module to avoid inter-file test pollution?
It seems like something that is mocked in one Python test file remains mocked in other file with the same return value, which means my mocks are persisting between tests and files (when a patch decorator or with patch
block is NOT used).
Is there any way around this other than patching? There wouldn't happen to be a mock.reset_all_mocks()
or something like that, would there?