Skip to content

Commit 6219137

Browse files
committed
use session scope for utest performance, increase atest timeouts
1 parent bc59fda commit 6219137

File tree

3 files changed

+13
-10
lines changed

3 files changed

+13
-10
lines changed

tests/acceptance/Classic.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,12 @@ Launch Browser Tab
2727
Click Launcher foo
2828
Wait Until Keyword Succeeds 3x 0.5s Switch Window title:Hello World
2929
Location Should Contain foo
30-
Page Should Contain Hello World
30+
Wait Until Page Contains Hello World timeout=10s
3131
Close Window
3232

3333
Launch Another Browser Tab
3434
Click Launcher bar
3535
Wait Until Keyword Succeeds 3x 0.5s Switch Window title:Hello World
3636
Location Should Contain bar
37-
Page Should Contain Hello World
37+
Wait Until Page Contains Hello World timeout=10s
3838
Close Window

tests/acceptance/Lab.robot

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,15 @@ Launch Browser Tab
1717
Click Launcher foo
1818
Wait Until Keyword Succeeds 3x 0.5s Switch Window title:Hello World
1919
Location Should Contain foo
20-
Page Should Contain Hello World
20+
Wait Until Page Contains Hello World timeout=10s
2121
Close Window
2222
[Teardown] Switch Window title:JupyterLab
2323

2424
Launch Lab Tab
2525
Click Launcher bar
2626
Wait Until Page Contains Element css:iframe
2727
Select Frame css:iframe
28-
Page Should Contain Hello World
28+
Wait Until Page Contains Hello World timeout=10s
2929

3030
*** Keywords ***
3131
Start Lab Tests

tests/conftest.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,19 @@
1111
from urllib.request import urlopen
1212
from uuid import uuid4
1313

14-
from pytest import fixture
14+
from pytest import fixture, TempPathFactory
1515

1616
HERE = Path(__file__).parent
1717
RESOURCES = HERE / "resources"
1818

1919

20-
@fixture
20+
@fixture(scope="session")
2121
def a_token() -> str:
2222
"""Get a random UUID to use for a token."""
2323
return str(uuid4())
2424

2525

26-
@fixture
26+
@fixture(scope="session")
2727
def an_unused_port() -> int:
2828
"""Get a random unused port."""
2929
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
@@ -34,20 +34,23 @@ def an_unused_port() -> int:
3434
return port
3535

3636

37-
@fixture(params=["notebook", "lab"])
37+
@fixture(params=["notebook", "lab"], scope="session")
3838
def a_server_cmd(request: Any) -> str:
3939
"""Get a viable name for a command."""
4040
return request.param
4141

4242

43-
@fixture
43+
@fixture(scope="session")
4444
def a_server(
4545
a_server_cmd: str,
46-
tmp_path: Path,
46+
tmp_path_factory: TempPathFactory,
4747
an_unused_port: int,
4848
a_token: str,
4949
) -> Generator[str, None, None]:
5050
"""Get a running server."""
51+
52+
tmp_path = tmp_path_factory.mktemp(a_server_cmd)
53+
5154
# get a copy of the resources
5255
tests = tmp_path / "tests"
5356
tests.mkdir()

0 commit comments

Comments
 (0)