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')
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):