python:mocks
This is an old revision of the document!
Python Testing
Mocks
Don't use Python mocks. They don't work how you want.
- Mocks only kind of work. Code like `mock.patch()` Do not work at the module layer. If your code imports the patched symbol before the patch comes in, any code that already references gets the unpatched version. This means you have to chase down any existing references for it to work. That in turn means Tests will work in isolation but not when part of a suite.
python/mocks.1747098028.txt.gz · Last modified: by carl
