diff --git a/test/conftest.py b/test/conftest.py index ec30d02c5..6a724be4a 100644 --- a/test/conftest.py +++ b/test/conftest.py @@ -74,6 +74,9 @@ class SeleniumWrapper: class FirefoxWrapper(SeleniumWrapper): + + browser = 'firefox' + def get_driver(self): from selenium.webdriver import Firefox from selenium.webdriver.firefox.options import Options @@ -89,6 +92,9 @@ class FirefoxWrapper(SeleniumWrapper): class ChromeWrapper(SeleniumWrapper): + + browser = 'chrome' + def get_driver(self): from selenium.webdriver import Chrome from selenium.webdriver.chrome.options import Options diff --git a/test/test_common.py b/test/test_common.py index 15344cb25..3649b09d5 100644 --- a/test/test_common.py +++ b/test/test_common.py @@ -27,8 +27,8 @@ def registered_packages_meta(): for name in packages} -UNSUPPORTED_PACKAGES = {'ChromeWrapper': ['pandas'], - 'FirefoxWrapper': []} +UNSUPPORTED_PACKAGES = {'chrome': ['pandas'], + 'firefox': []} @pytest.mark.parametrize('name', registered_packages()) @@ -36,12 +36,10 @@ def test_import(name, selenium_standalone): # check that we can parse the meta.yaml meta = common.parse_package(PKG_DIR / name / 'meta.yaml') - if name in UNSUPPORTED_PACKAGES[selenium_standalone.__class__.__name__]: + if name in UNSUPPORTED_PACKAGES[selenium_standalone.browser]: pytest.xfail( - '{} fails to load and is not supported on {}.' - .format(name, - selenium_standalone.__class__.__name__ - .replace('Wrapper', ''))) + '{} fails to load and is not supported on {}.' + .format(name, selenium_standalone.browser)) for import_name in meta.get('test', {}).get('imports', []): selenium_standalone.load_package(name) diff --git a/test/test_pandas.py b/test/test_pandas.py index fe741bfc2..403f93f74 100644 --- a/test/test_pandas.py +++ b/test/test_pandas.py @@ -2,7 +2,7 @@ import pytest def test_pandas(selenium, request): - if 'chrome' in selenium.__class__.__name__.lower(): + if selenium.browser == 'chrome': request.applymarker(pytest.mark.xfail( run=False, reason='chrome not supported')) selenium.load_package("pandas") @@ -10,7 +10,7 @@ def test_pandas(selenium, request): def test_extra_import(selenium, request): - if 'chrome' in selenium.__class__.__name__.lower(): + if selenium.brower == 'chrome': request.applymarker(pytest.mark.xfail( run=False, reason='chrome not supported'))