From 2fa0dd73b18f55d0fdd1c1d54b1d18031bfcf1ed Mon Sep 17 00:00:00 2001 From: Florian Apolloner Date: Sat, 14 Sep 2013 23:23:45 +0200 Subject: [PATCH] Fixed error handling in 3c5775d36f7e431d9691829a78580873111cb714 for non-operational webdrivers. --- django/contrib/admin/tests.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/django/contrib/admin/tests.py b/django/contrib/admin/tests.py index 24d8937eed..a8ece9d381 100644 --- a/django/contrib/admin/tests.py +++ b/django/contrib/admin/tests.py @@ -23,11 +23,15 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase): raise SkipTest('Selenium tests not requested') try: 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))) + except ImportError as e: + raise SkipTest('Selenium webdriver "%s" not installed: %s' + % (cls.webdriver_class, str(e))) super(AdminSeleniumWebDriverTestCase, cls).setUpClass() - cls.selenium = webdriver_class() + try: + cls.selenium = webdriver_class() + except Exception as e: + raise SkipTest('Selenium webdriver "%s" not operational: %s' + % (cls.webdriver_class, str(e))) @classmethod def tearDownClass(cls):