Skip to content

Commit 33007a0

Browse files
committed
[py] Implementing ability to force a new driver creation after some tests (that quit the driver)
1 parent 9d250d6 commit 33007a0

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

py/conftest.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,9 @@ def fin():
107107
kwargs.update({'desired_capabilities': capabilities})
108108
driver_instance = getattr(webdriver, driver_class)(**kwargs)
109109
yield driver_instance
110+
if MarkEvaluator(request.node, 'no_driver_after_test').istrue():
111+
driver_instance = None
112+
110113

111114

112115
@pytest.fixture(scope='session', autouse=True)

py/test/selenium/webdriver/common/quit_tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import pytest
1919

2020

21+
@pytest.mark.no_driver_after_test
2122
def test_quit(driver, pages):
2223
driver.quit()
2324
with pytest.raises(Exception):

0 commit comments

Comments
 (0)