Skip to content

Commit

Permalink
Fix test on Linux
Browse files Browse the repository at this point in the history
  • Loading branch information
vidartf committed Oct 14, 2022
1 parent 760c90e commit 1b9790e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions jupyter_server/services/contents/filemanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,6 @@ def _default_preferred_dir(self):
DeprecationWarning,
stacklevel=3,
)
if not os.path.isdir(value):
raise TraitError(_i18n("No such preferred dir: %r") % value)
if not (value + os.path.sep).startswith(self.root_dir):
raise TraitError("%s is outside root contents directory" % value)
return os.path.relpath(value, self.root_dir).replace(os.path.sep, "/")
Expand Down
2 changes: 1 addition & 1 deletion tests/test_serverapp.py
Original file line number Diff line number Diff line change
Expand Up @@ -406,4 +406,4 @@ def test_absolute_preferred_dir_not_root_subdir_set(tmp_path, jp_configurable_se
if os.name == "nt":
assert "is not a relative API path" in str(error)
else:
assert "No such directory" in str(error)
assert "Preferred directory not found" in str(error)

0 comments on commit 1b9790e

Please sign in to comment.