Browse Source

Tests: Make it possible to run suite without celery pytest plugin. Closes #3530

Ask Solem 8 years ago
parent
commit
d0c8898f40
1 changed files with 11 additions and 0 deletions
  1. 11 0
      t/unit/conftest.py

+ 11 - 0
t/unit/conftest.py

@@ -15,11 +15,22 @@ from case.utils import decorator
 from kombu import Queue
 
 from celery.backends.cache import CacheBackend, DummyClient
+# we have to import the pytest plugin fixtures here,
+# in case user did not do the `python setup.py develop` yet,
+# that installs the pytest plugin into the setuptools registry.
+from celery.contrib.pytest import (
+    celery_app, celery_enable_logging, depends_on_current_app,
+)
 from celery.contrib.testing.app import Trap, TestApp
 from celery.contrib.testing.mocks import (
     TaskMessage, TaskMessage1, task_message_from_sig,
 )
 
+# Tricks flake8 into silencing redefining fixtures warnings.
+__all__ = [
+    'celery_app', 'celery_enable_logging', 'depends_on_current_app',
+]
+
 try:
     WindowsError = WindowsError  # noqa
 except NameError: