1+ import os
2+
13import pytest
24from asphalt .core import Context
35from httpx import AsyncClient
2022
2123
2224@pytest .mark .asyncio
23- async def test_kernel_channels_unauthenticated (unused_tcp_port ):
25+ async def test_kernel_channels_unauthenticated (unused_tcp_port , tmp_path ):
26+ os .chdir (tmp_path )
2427 async with Context () as ctx :
2528 await JupyverseComponent (
2629 components = COMPONENTS ,
@@ -35,7 +38,8 @@ async def test_kernel_channels_unauthenticated(unused_tcp_port):
3538
3639
3740@pytest .mark .asyncio
38- async def test_kernel_channels_authenticated (unused_tcp_port ):
41+ async def test_kernel_channels_authenticated (unused_tcp_port , tmp_path ):
42+ os .chdir (tmp_path )
3943 async with Context () as ctx , AsyncClient () as http :
4044 await JupyverseComponent (
4145 components = COMPONENTS ,
@@ -52,7 +56,8 @@ async def test_kernel_channels_authenticated(unused_tcp_port):
5256
5357@pytest .mark .asyncio
5458@pytest .mark .parametrize ("auth_mode" , ("noauth" , "token" , "user" ))
55- async def test_root_auth (auth_mode , unused_tcp_port ):
59+ async def test_root_auth (auth_mode , unused_tcp_port , tmp_path ):
60+ os .chdir (tmp_path )
5661 components = configure (COMPONENTS , {"auth" : {"mode" : auth_mode }})
5762 async with Context () as ctx , AsyncClient () as http :
5863 await JupyverseComponent (
@@ -72,7 +77,8 @@ async def test_root_auth(auth_mode, unused_tcp_port):
7277
7378@pytest .mark .asyncio
7479@pytest .mark .parametrize ("auth_mode" , ("noauth" ,))
75- async def test_no_auth (auth_mode , unused_tcp_port ):
80+ async def test_no_auth (auth_mode , unused_tcp_port , tmp_path ):
81+ os .chdir (tmp_path )
7682 components = configure (COMPONENTS , {"auth" : {"mode" : auth_mode }})
7783 async with Context () as ctx , AsyncClient () as http :
7884 await JupyverseComponent (
@@ -86,7 +92,8 @@ async def test_no_auth(auth_mode, unused_tcp_port):
8692
8793@pytest .mark .asyncio
8894@pytest .mark .parametrize ("auth_mode" , ("token" ,))
89- async def test_token_auth (auth_mode , unused_tcp_port ):
95+ async def test_token_auth (auth_mode , unused_tcp_port , tmp_path ):
96+ os .chdir (tmp_path )
9097 components = configure (COMPONENTS , {"auth" : {"mode" : auth_mode }})
9198 async with Context () as ctx , AsyncClient () as http :
9299 await JupyverseComponent (
@@ -113,7 +120,8 @@ async def test_token_auth(auth_mode, unused_tcp_port):
113120 {"admin" : ["read" ], "foo" : ["bar" , "baz" ]},
114121 ),
115122)
116- async def test_permissions (auth_mode , permissions , unused_tcp_port ):
123+ async def test_permissions (auth_mode , permissions , unused_tcp_port , tmp_path ):
124+ os .chdir (tmp_path )
117125 components = configure (COMPONENTS , {"auth" : {"mode" : auth_mode }})
118126 async with Context () as ctx , AsyncClient () as http :
119127 await JupyverseComponent (
0 commit comments