Skip to content

Commit 222bbf3

Browse files
committed
-
1 parent 2dc88a6 commit 222bbf3

File tree

8 files changed

+39
-13
lines changed

8 files changed

+39
-13
lines changed

plugins/webdav/tests/test_webdav.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,9 @@ async def test_webdav(unused_tcp_port):
4242
}
4343
},
4444
)
45-
async with get_root_module(config):
45+
root_module = get_root_module(config)
46+
root_module._global_start_timeout = 10
47+
async with root_module:
4648
webdav = easywebdav.connect(
4749
"127.0.0.1", port=unused_tcp_port, path="webdav", username="foo", password="bar"
4850
)

plugins/yjs/tests/test_yjs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@ async def test_concurrent_disconnect(tmp_path, anyio_backend_name):
5757
}
5858

5959
with capture_logs() as cap_logs:
60-
async with get_root_module(config) as root_module:
60+
root_module = get_root_module(config)
61+
root_module._global_start_timeout = 10
62+
async with root_module as root_module:
6163
app = root_module.app
6264
transport = ASGIWebSocketTransport(app=app)
6365
async with AsyncClient(transport=transport, base_url="http://testserver") as client:

tests/test_app.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,9 @@ async def test_mount_path(mount_path, unused_tcp_port):
2828
}
2929
}
3030

31-
async with AsyncClient() as http, get_root_module(config) as jupyverse_module:
31+
root_module = get_root_module(config)
32+
root_module._global_start_timeout = 10
33+
async with AsyncClient() as http, root_module as jupyverse_module:
3234
app = await jupyverse_module.get(App)
3335
router = APIRouter()
3436

tests/test_auth.py

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,9 @@
5757
@pytest.mark.anyio
5858
async def test_kernel_channels_unauthenticated(unused_tcp_port):
5959
config = merge_config(CONFIG, {"jupyverse": {"config": {"port": unused_tcp_port}}})
60-
async with get_root_module(config):
60+
root_module = get_root_module(config)
61+
root_module._global_start_timeout = 10
62+
async with root_module:
6163
with pytest.raises(WebSocketUpgradeError):
6264
async with aconnect_ws(
6365
f"http://127.0.0.1:{unused_tcp_port}/api/kernels/kernel_id_0/channels?session_id=session_id_0",
@@ -68,7 +70,9 @@ async def test_kernel_channels_unauthenticated(unused_tcp_port):
6870
@pytest.mark.anyio
6971
async def test_kernel_channels_authenticated(unused_tcp_port):
7072
config = merge_config(CONFIG, {"jupyverse": {"config": {"port": unused_tcp_port}}})
71-
async with get_root_module(config), AsyncClient() as http:
73+
root_module = get_root_module(config)
74+
root_module._global_start_timeout = 10
75+
async with root_module, AsyncClient() as http:
7276
await authenticate_client(http, unused_tcp_port)
7377
async with aconnect_ws(
7478
f"http://127.0.0.1:{unused_tcp_port}/api/kernels/kernel_id_0/channels?session_id=session_id_0",
@@ -95,7 +99,9 @@ async def test_root_auth(auth_mode, unused_tcp_port):
9599
}
96100
},
97101
)
98-
async with get_root_module(config), AsyncClient() as http:
102+
root_module = get_root_module(config)
103+
root_module._global_start_timeout = 10
104+
async with root_module, AsyncClient() as http:
99105
response = await http.get(f"http://127.0.0.1:{unused_tcp_port}/")
100106
if auth_mode == "noauth":
101107
expected = 302
@@ -124,7 +130,9 @@ async def test_no_auth(auth_mode, unused_tcp_port):
124130
}
125131
},
126132
)
127-
async with get_root_module(config), AsyncClient() as http:
133+
root_module = get_root_module(config)
134+
root_module._global_start_timeout = 10
135+
async with root_module, AsyncClient() as http:
128136
response = await http.get(f"http://127.0.0.1:{unused_tcp_port}/lab")
129137
assert response.status_code == 200
130138

@@ -147,7 +155,9 @@ async def test_token_auth(auth_mode, unused_tcp_port):
147155
}
148156
},
149157
)
150-
async with get_root_module(config) as jupyverse, AsyncClient() as http:
158+
root_module = get_root_module(config)
159+
root_module._global_start_timeout = 10
160+
async with root_module as jupyverse, AsyncClient() as http:
151161
auth_config = await jupyverse.get(AuthConfig)
152162

153163
# no token provided, should not work
@@ -183,7 +193,9 @@ async def test_permissions(auth_mode, permissions, unused_tcp_port):
183193
}
184194
},
185195
)
186-
async with get_root_module(config), AsyncClient() as http:
196+
root_module = get_root_module(config)
197+
root_module._global_start_timeout = 10
198+
async with root_module, AsyncClient() as http:
187199
await authenticate_client(http, unused_tcp_port, permissions=permissions)
188200
response = await http.get(f"http://127.0.0.1:{unused_tcp_port}/auth/user/me")
189201
if "admin" in permissions.keys():

tests/test_contents.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ async def test_tree(auth_mode, tmp_path, unused_tcp_port):
9393
}
9494
},
9595
)
96-
async with get_root_module(config), AsyncClient() as http:
96+
root_module = get_root_module(config)
97+
root_module._global_start_timeout = 10
98+
async with root_module, AsyncClient() as http:
9799
response = await http.get(
98100
f"http://127.0.0.1:{unused_tcp_port}/api/contents", params={"content": 1}
99101
)

tests/test_execute.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,9 @@ async def test_execute(auth_mode, unused_tcp_port):
112112
}
113113
},
114114
)
115-
async with get_root_module(config), AsyncClient() as http:
115+
root_module = get_root_module(config)
116+
root_module._global_start_timeout = 10
117+
async with root_module, AsyncClient() as http:
116118
ws_url = url.replace("http", "ws", 1)
117119
name = "notebook1.ipynb"
118120
path = (Path("tests") / "data" / name).as_posix()

tests/test_kernels.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ async def test_kernel_messages(auth_mode, capfd):
9393
}
9494
},
9595
)
96-
async with get_root_module(config) as root_module:
96+
root_module = get_root_module(config)
97+
root_module._global_start_timeout = 10
98+
async with root_module as root_module:
9799
app = root_module.app
98100
transport = ASGIWebSocketTransport(app=app)
99101
async with AsyncClient(transport=transport, base_url="http://testserver") as client:

tests/test_settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,9 @@ async def test_settings(auth_mode, unused_tcp_port):
7272
}
7373
},
7474
)
75-
async with get_root_module(config), AsyncClient() as http:
75+
root_module = get_root_module(config)
76+
root_module._global_start_timeout = 10
77+
async with root_module, AsyncClient() as http:
7678
# get previous theme
7779
response = await http.get(
7880
f"http://127.0.0.1:{unused_tcp_port}/lab/api/settings/@jupyterlab/apputils-extension:themes"

0 commit comments

Comments
 (0)