django-test-extensions icon indicating copy to clipboard operation
django-test-extensions copied to clipboard

ImportError: cannot import name run_tests

Open laplacesdemon opened this issue 12 years ago • 1 comments

I've installed the app and when I tried python manage.py test --coverage I got the following error:

ImportError: cannot import name run_tests

It seems the cause of the problem is at this file: https://github.com/garethr/django-test-extensions/blob/master/src/test_extensions/testrunners/codecoverage.py

from django.test.simple import run_tests as django_test_runner

Apparently django doesn't have run_tests function anymore. Instead they encapsulated it with DjangoTestSuiteRunner class.

It'd be great if anyone fix this. Btw, I use Django 1.5

laplacesdemon avatar Mar 20 '13 13:03 laplacesdemon

Yes you should use DjangoTestSuiteRunner

from django.test.simple import DjangoTestSuiteRunner test_runner = DjangoTestSuiteRunner(verbosity=1) test_runner.run_tests(...........)

0xbepresent avatar Nov 20 '13 17:11 0xbepresent