Skip to content

Commit

Permalink
Don't monkeypatch environment data locations for test notebook server
Browse files Browse the repository at this point in the history
  • Loading branch information
takluyver committed Dec 9, 2019
1 parent 5e5ad60 commit d6259ae
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions notebook/tests/launchnotebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,12 +124,15 @@ def tmp(*parts):
cls.notebook_dir = tmp('notebooks')
cls.env_patch = patch.dict('os.environ', cls.get_patch_env())
cls.env_patch.start()
# Patch systemwide & user-wide data & config directories, to isolate
# the tests from oddities of the local setup. But leave Python env
# locations alone, so data files for e.g. nbconvert are accessible.
# If this isolation isn't sufficient, you may need to run the tests in
# a virtualenv or conda env.
cls.path_patch = patch.multiple(
jupyter_core.paths,
SYSTEM_JUPYTER_PATH=[tmp('share', 'jupyter')],
ENV_JUPYTER_PATH=[tmp('env', 'share', 'jupyter')],
SYSTEM_CONFIG_PATH=[tmp('etc', 'jupyter')],
ENV_CONFIG_PATH=[tmp('env', 'etc', 'jupyter')],
)
cls.path_patch.start()

Expand Down

0 comments on commit d6259ae

Please sign in to comment.