Project

General

Profile

« Previous | Next » 

Revision ee0a4a93

Added by koszko over 1 year ago

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).

View differences:

test/haketilo_test/conftest.py
46 46

  
47 47
@pytest.fixture(scope="session")
48 48
def _driver(proxy):
49
    with firefox_safe_mode() as driver:
49
    with firefox_safe_mode(proxy.server_port) as driver:
50 50
        yield driver
51 51
        driver.quit()
52 52

  
......
57 57
    driver.switch_to.window(driver.window_handles[0])
58 58

  
59 59
@pytest.fixture()
60
def driver(_driver, request):
60
def driver(proxy, _driver, request):
61 61
    nav_target = request.node.get_closest_marker('get_page')
62 62
    nav_target = nav_target.args[0] if nav_target else 'about:blank'
63 63

  
64 64
    second_driver = request.node.get_closest_marker('second_driver')
65 65

  
66 66
    if second_driver:
67
        with firefox_safe_mode() as _driver:
67
        with firefox_safe_mode(proxy.server_port) as _driver:
68 68
            _driver.get(nav_target)
69 69
            yield _driver
70 70
            _driver.quit()

Also available in: Unified diff