fromNedbatchelder2 days agoPythonWhy your mock breaks laterPatch mocks where the object is used, not where it's defined, to avoid unintended, global effects on other libraries and test infrastructure.