Fixed error handling in 3c5775d36f for non-operational webdrivers.

This commit is contained in:
Florian Apolloner 2013-09-14 23:23:45 +02:00
parent 3c5775d36f
commit 2fa0dd73b1
1 changed files with 8 additions and 4 deletions

View File

@ -23,11 +23,15 @@ class AdminSeleniumWebDriverTestCase(StaticLiveServerCase):
raise SkipTest('Selenium tests not requested') raise SkipTest('Selenium tests not requested')
try: try:
webdriver_class = import_by_path(cls.webdriver_class) webdriver_class = import_by_path(cls.webdriver_class)
except Exception as e: except ImportError as e:
raise SkipTest('Selenium webdriver "%s" not installed or not ' raise SkipTest('Selenium webdriver "%s" not installed: %s'
'operational: %s' % (cls.webdriver_class, str(e))) % (cls.webdriver_class, str(e)))
super(AdminSeleniumWebDriverTestCase, cls).setUpClass() super(AdminSeleniumWebDriverTestCase, cls).setUpClass()
try:
cls.selenium = webdriver_class() cls.selenium = webdriver_class()
except Exception as e:
raise SkipTest('Selenium webdriver "%s" not operational: %s'
% (cls.webdriver_class, str(e)))
@classmethod @classmethod
def tearDownClass(cls): def tearDownClass(cls):