diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py index 4b424b72cd..24d8937eed 100644 --- a/django/contrib/admin/tests.py +++ b/django/contrib/admin/tests.py @@ -22,11 +22,12 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): if not os.environ.get('DJANGO_SELENIUM_TESTS', False): raise SkipTest('Selenium tests not requested') try: - cls.selenium = import_by_path(cls.webdriver_class)() + webdriver_class = import_by_path(cls.webdriver_class) except Exception as e: raise SkipTest('Selenium webdriver "%s" not installed or not ' 'operational: %s' % (cls.webdriver_class, str(e))) super(AdminSeleniumWebDriverTestCase, cls).setUpClass() + cls.selenium = webdriver_class() @classmethod def tearDownClass(cls):