Browse Source

Pytest plugin shouldnt register reset_cache_backend_state fixture

Ask Solem 8 years ago
parent
commit
de27d1fa39
1 changed files with 0 additions and 14 deletions
  1. 0 14
      celery/contrib/pytest.py

+ 0 - 14
celery/contrib/pytest.py

@@ -6,8 +6,6 @@ import pytest
 
 from contextlib import contextmanager
 
-from celery.backends.cache import CacheBackend, DummyClient
-
 from .testing import worker
 from .testing.app import TestApp, setup_default_app
 
@@ -154,15 +152,3 @@ def celery_worker(request, celery_app, celery_includes, celery_worker_pool):
 def depends_on_current_app(celery_app):
     """Fixture that sets app as current."""
     celery_app.set_current()
-
-
-@pytest.fixture(autouse=True)
-def reset_cache_backend_state(celery_app):
-    """Fixture that resets the internal state of the cache result backend."""
-    yield
-    backend = celery_app.__dict__.get('backend')
-    if backend is not None:
-        if isinstance(backend, CacheBackend):
-            if isinstance(backend.client, DummyClient):
-                backend.client.cache.clear()
-            backend._cache.clear()