Browse Source

Add the test-runner from yadayada into the repo so we don't depend on yadayada
anymore. Closes #4.

Ask Solem 16 years ago
parent
commit
af9ba75e19
2 changed files with 15 additions and 1 deletions
  1. 14 0
      celery/tests/runners.py
  2. 1 1
      testproj/settings.py

+ 14 - 0
celery/tests/runners.py

@@ -0,0 +1,14 @@
+from django.conf import settings
+from django.test.simple import run_tests as django_test_runner
+
+
+def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=None,
+        **kwargs):
+    """ Test runner that only runs tests for the apps
+    listed in ``settings.TEST_APPS``.
+    """
+    extra_tests = extra_tests or []
+    app_labels = getattr(settings, "TEST_APPS", test_labels)
+    return django_test_runner(app_labels,
+                              verbosity=verbosity, interactive=interactive,
+                              extra_tests=extra_tests, **kwargs)

+ 1 - 1
testproj/settings.py

@@ -12,7 +12,7 @@ ADMINS = (
     # ('Your Name', 'your_email@domain.com'),
 )
 
-TEST_RUNNER = "yadayada.test.run_tests"
+TEST_RUNNER = "celery.tests.runners.run_tests"
 TEST_APPS = (
     "celery",
 )