mirror of
https://github.com/django/django.git
synced 2025-10-24 06:06:09 +00:00
Fixed #24290 -- Skipped postgres_tests if not running with PostgreSQL.
This commit is contained in:
@@ -84,7 +84,7 @@ def get_test_modules():
|
||||
os.path.isfile(f) or
|
||||
not os.path.exists(os.path.join(dirpath, f, '__init__.py'))):
|
||||
continue
|
||||
if not connection.vendor == 'postgresql' and f == 'postgres_tests' or f == 'postgres':
|
||||
if connection.vendor != 'postgresql' and f == 'postgres_tests':
|
||||
continue
|
||||
modules.append((modpath, f))
|
||||
return modules
|
||||
@@ -230,6 +230,11 @@ def django_tests(verbosity, interactive, failfast, keepdb, reverse, test_labels,
|
||||
state = setup(verbosity, test_labels)
|
||||
extra_tests = []
|
||||
|
||||
if test_labels and 'postgres_tests' in test_labels and connection.vendor != 'postgres':
|
||||
if verbosity >= 2:
|
||||
print("Removed postgres_tests from tests as we're not running with PostgreSQL.")
|
||||
test_labels.remove('postgres_tests')
|
||||
|
||||
# Run the test suite, including the extra validation tests.
|
||||
if not hasattr(settings, 'TEST_RUNNER'):
|
||||
settings.TEST_RUNNER = 'django.test.runner.DiscoverRunner'
|
||||
|
||||
Reference in New Issue
Block a user