Skip to content

Commit 01a6884

Browse files
added change to accomodate changes in PR-15794
1 parent c36b3c5 commit 01a6884

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

py/conftest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -485,21 +485,21 @@ def firefox_options(request):
485485
@pytest.fixture
486486
def chromium_options(request):
487487
try:
488-
driver_option = request.config.option.drivers[0].lower()
488+
driver_class = request.config.option.drivers[0].lower()
489489
except (AttributeError, TypeError):
490490
raise Exception("This test requires a --driver to be specified")
491-
492491
# Skip if not Chrome or Edge
493-
if driver_option not in ("chrome", "edge"):
494-
pytest.skip(f"This test requires Chrome or Edge, got {driver_option}")
492+
if driver_class not in ("chrome", "edge"):
493+
pytest.skip(f"This test requires Chrome or Edge, got {driver_class}")
495494

495+
selenium_driver = Driver(driver_class, request)
496496
# skip tests in the 'remote' directory if run with a local driver
497-
if request.node.path.parts[-2] == "remote" and get_driver_class(driver_option) != "Remote":
498-
pytest.skip(f"Remote tests can't be run with driver '{driver_option}'")
497+
if selenium_driver.skip_remote_tests:
498+
pytest.skip(f"Remote tests can't be run with driver '{driver_class}'")
499499

500-
if driver_option == "chrome":
500+
if driver_class == "chrome":
501501
options = webdriver.ChromeOptions()
502-
elif driver_option == "edge":
502+
elif driver_class == "edge":
503503
options = webdriver.EdgeOptions()
504504

505505
if request.config.option.headless:

0 commit comments

Comments
 (0)