runners.py 751 B

12345678910111213141516171819
  1. from django.conf import settings
  2. from django.test.simple import run_tests as django_test_runner
  3. def run_tests(test_labels, verbosity=1, interactive=True, extra_tests=None,
  4. **kwargs):
  5. """ Test runner that only runs tests for the apps
  6. listed in ``settings.TEST_APPS``.
  7. """
  8. extra_tests = extra_tests or []
  9. app_labels = getattr(settings, "TEST_APPS", test_labels)
  10. # Seems to be deleting the test database file twice :(
  11. from celery.utils import noop
  12. from django.db import connection
  13. connection.creation.destroy_test_db = noop
  14. return django_test_runner(app_labels,
  15. verbosity=verbosity, interactive=interactive,
  16. extra_tests=extra_tests, **kwargs)