dogpile.cache
dogpile.cache copied to clipboard
tests.cache._fixtures._GenericBackendFixture breaks on `tearDown` if the region has args.
Migrated issue, originally created by jvanasco (jvanasco)
If the region's class has region_args
set, tearDown breaks.
def tearDown(self):
if self._region_inst:
- for key in self._keys:
+ for key in self._keys.copy(): # iterate over a copy, otherwise the dict changes
self._region_inst.delete(key)
self._keys.clear()
elif self._backend_inst:
self._backend_inst.delete("some_key")
The tearDown
is also oversimplified -- it doesn't track or teardown the created keys.. just this example key.