summaryrefslogtreecommitdiff
path: root/test/haketilo_test/conftest.py
diff options
context:
space:
mode:
authorWojtek Kosior <koszko@koszko.org>2022-02-17 16:31:42 +0100
committerWojtek Kosior <koszko@koszko.org>2022-02-17 16:34:56 +0100
commitee0a4a935a95a9472655f85a04e1323f3d328898 (patch)
tree2a2228b138be8979f19cca334a8802e33540acbe /test/haketilo_test/conftest.py
parent3e4bde861cdee3312e1d410dc08f67d8e7c9168c (diff)
downloadbrowser-extension-ee0a4a935a95a9472655f85a04e1323f3d328898.tar.gz
browser-extension-ee0a4a935a95a9472655f85a04e1323f3d328898.zip
automatically pick up a free port to run the HTTP proxy on
It is now possible to run multiple `make test` commands in parallel (e.g. testing abrowser and librewolf simultaneously after running `configure` for each of them in 2 different directories).
Diffstat (limited to 'test/haketilo_test/conftest.py')
-rw-r--r--test/haketilo_test/conftest.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/haketilo_test/conftest.py b/test/haketilo_test/conftest.py
index 9103ac8..834f026 100644
--- a/test/haketilo_test/conftest.py
+++ b/test/haketilo_test/conftest.py
@@ -46,7 +46,7 @@ def proxy():
@pytest.fixture(scope="session")
def _driver(proxy):
- with firefox_safe_mode() as driver:
+ with firefox_safe_mode(proxy.server_port) as driver:
yield driver
driver.quit()
@@ -57,14 +57,14 @@ def close_all_but_one_window(driver):
driver.switch_to.window(driver.window_handles[0])
@pytest.fixture()
-def driver(_driver, request):
+def driver(proxy, _driver, request):
nav_target = request.node.get_closest_marker('get_page')
nav_target = nav_target.args[0] if nav_target else 'about:blank'
second_driver = request.node.get_closest_marker('second_driver')
if second_driver:
- with firefox_safe_mode() as _driver:
+ with firefox_safe_mode(proxy.server_port) as _driver:
_driver.get(nav_target)
yield _driver
_driver.quit()