Skip to content

Commit

Permalink
update Memcached test
Browse files Browse the repository at this point in the history
  • Loading branch information
drcpu-github committed Jul 22, 2023
1 parent 2322e34 commit 543cbd5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/test_memcached_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@
def cache_factory(request):
def _factory(self, *args, **kwargs):
mc = MemcachedCache(*args, **kwargs)
mc._client.flush_all()
if mc.pylibmc_used:
with mc._client.reserve(block=mc.blocking) as client:
client.flush_all()
else:
mc._client.flush_all()
return mc

request.cls.cache_factory = _factory
Expand Down

0 comments on commit 543cbd5

Please sign in to comment.