diff --git a/notebook/tests/test_serverextensions.py b/notebook/tests/test_serverextensions.py index 35da80d4c5..898647926b 100644 --- a/notebook/tests/test_serverextensions.py +++ b/notebook/tests/test_serverextensions.py @@ -1,5 +1,6 @@ import imp import os +import site import sys from unittest import TestCase from unittest.mock import patch @@ -84,6 +85,11 @@ def setUp(self): p = patch.object(mod, 'ENV_CONFIG_PATH', []) self.patches.append(p) + # avoid adding the user site to the config paths with jupyter-core >= 4.9 + # https://github.com/jupyter/jupyter_core/pull/242 + p = patch.object(site, + 'ENABLE_USER_SITE', False) + self.patches.append(p) for p in self.patches: p.start() self.addCleanup(p.stop)