Skip to content

Commit ce5d9de

Browse files
authored
Merge pull request #4 from kevin-bates/fix-contents-mgr-fixture
Fix contents mgr fixture, add large file fixture
2 parents 5737af9 + bf77285 commit ce5d9de

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

pytest_jupyter/jupyter_server.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from jupyter_server.serverapp import ServerApp
1616
from jupyter_server.utils import url_path_join
1717
from jupyter_server.services.contents.filemanager import FileContentsManager
18+
from jupyter_server.services.contents.largefilemanager import LargeFileManager
1819
from tornado.escape import url_escape
1920
from traitlets.config import Config
2021

@@ -254,9 +255,15 @@ def jp_kernelspecs(jp_data_dir):
254255

255256

256257
@pytest.fixture(params=[True, False])
257-
def jp_contents_manager(request, jp_root_dir):
258+
def jp_contents_manager(request, tmp_path):
258259
"""Returns a FileContentsManager instance based on the use_atomic_writing parameter value."""
259-
return FileContentsManager(root_dir=str(jp_root_dir), use_atomic_writing=request.param)
260+
return FileContentsManager(root_dir=str(tmp_path), use_atomic_writing=request.param)
261+
262+
263+
@pytest.fixture
264+
def jp_large_contents_manager(tmp_path):
265+
"""Returns a LargeFileManager instance."""
266+
return LargeFileManager(root_dir=str(tmp_path))
260267

261268

262269
@pytest.fixture

0 commit comments

Comments
 (0)