mirror of
https://github.com/django/django.git
synced 2025-04-01 12:06:43 +00:00
Fixed #25941 -- Improved error message for runtests.py when django is not on path.
This commit is contained in:
parent
e6d57c4d65
commit
3e8b733390
@ -10,18 +10,24 @@ import sys
|
|||||||
import tempfile
|
import tempfile
|
||||||
import warnings
|
import warnings
|
||||||
|
|
||||||
import django
|
try:
|
||||||
from django.apps import apps
|
import django
|
||||||
from django.conf import settings
|
except ImportError as e:
|
||||||
from django.db import connection, connections
|
raise RuntimeError(
|
||||||
from django.test import TestCase, TransactionTestCase
|
'Django module not found, reference tests/README.rst for instructions.'
|
||||||
from django.test.runner import default_test_processes
|
) from e
|
||||||
from django.test.selenium import SeleniumTestCaseBase
|
else:
|
||||||
from django.test.utils import get_runner
|
from django.apps import apps
|
||||||
from django.utils.deprecation import (
|
from django.conf import settings
|
||||||
RemovedInDjango31Warning, RemovedInDjango40Warning,
|
from django.db import connection, connections
|
||||||
)
|
from django.test import TestCase, TransactionTestCase
|
||||||
from django.utils.log import DEFAULT_LOGGING
|
from django.test.runner import default_test_processes
|
||||||
|
from django.test.selenium import SeleniumTestCaseBase
|
||||||
|
from django.test.utils import get_runner
|
||||||
|
from django.utils.deprecation import (
|
||||||
|
RemovedInDjango31Warning, RemovedInDjango40Warning,
|
||||||
|
)
|
||||||
|
from django.utils.log import DEFAULT_LOGGING
|
||||||
|
|
||||||
try:
|
try:
|
||||||
import MySQLdb
|
import MySQLdb
|
||||||
|
Loading…
x
Reference in New Issue
Block a user