57
57
@pytest .mark .anyio
58
58
async def test_kernel_channels_unauthenticated (unused_tcp_port ):
59
59
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 :
61
63
with pytest .raises (WebSocketUpgradeError ):
62
64
async with aconnect_ws (
63
65
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):
68
70
@pytest .mark .anyio
69
71
async def test_kernel_channels_authenticated (unused_tcp_port ):
70
72
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 :
72
76
await authenticate_client (http , unused_tcp_port )
73
77
async with aconnect_ws (
74
78
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):
95
99
}
96
100
},
97
101
)
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 :
99
105
response = await http .get (f"http://127.0.0.1:{ unused_tcp_port } /" )
100
106
if auth_mode == "noauth" :
101
107
expected = 302
@@ -124,7 +130,9 @@ async def test_no_auth(auth_mode, unused_tcp_port):
124
130
}
125
131
},
126
132
)
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 :
128
136
response = await http .get (f"http://127.0.0.1:{ unused_tcp_port } /lab" )
129
137
assert response .status_code == 200
130
138
@@ -147,7 +155,9 @@ async def test_token_auth(auth_mode, unused_tcp_port):
147
155
}
148
156
},
149
157
)
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 :
151
161
auth_config = await jupyverse .get (AuthConfig )
152
162
153
163
# no token provided, should not work
@@ -183,7 +193,9 @@ async def test_permissions(auth_mode, permissions, unused_tcp_port):
183
193
}
184
194
},
185
195
)
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 :
187
199
await authenticate_client (http , unused_tcp_port , permissions = permissions )
188
200
response = await http .get (f"http://127.0.0.1:{ unused_tcp_port } /auth/user/me" )
189
201
if "admin" in permissions .keys ():
0 commit comments