summaryrefslogtreecommitdiff
path: root/tests/runtests.py
diff options
context:
space:
mode:
authorMy-Name-Is-Nabil <midorady9999@gmail.com>2022-01-20 21:29:16 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2022-01-21 21:54:10 +0100
commit9dc65263d47a5b8857492c10ce151bab83cfe672 (patch)
treebfd6e7e544ce680525090030d064e2e39dad1175 /tests/runtests.py
parent2d8232fa716f5fe46eec9f35a0e90c2d0f126279 (diff)
downloaddjango-9dc65263d47a5b8857492c10ce151bab83cfe672.tar.gz
Fixed #33455 -- Improved error message when selenium is not installed.
Diffstat (limited to 'tests/runtests.py')
-rwxr-xr-xtests/runtests.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/runtests.py b/tests/runtests.py
index 2ec5d32969..6bad838a95 100755
--- a/tests/runtests.py
+++ b/tests/runtests.py
@@ -21,6 +21,7 @@ except ImportError as e:
else:
from django.apps import apps
from django.conf import settings
+ from django.core.exceptions import ImproperlyConfigured
from django.db import connection, connections
from django.test import TestCase, TransactionTestCase
from django.test.runner import get_max_test_processes, parallel_type
@@ -321,6 +322,10 @@ class ActionSelenium(argparse.Action):
Validate the comma-separated list of requested browsers.
"""
def __call__(self, parser, namespace, values, option_string=None):
+ try:
+ import selenium # NOQA
+ except ImportError as e:
+ raise ImproperlyConfigured(f'Error loading selenium module: {e}')
browsers = values.split(',')
for browser in browsers:
try: