fromNedbatchelder17 hours agoPythonTesting: exceptions and cachesUse parameterized tests to unify success and exception cases, and clear or reset lru_cache between tests to avoid cached state leaking across tests.
PythonfromNedbatchelder2 months agoWhy 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.