diff --git a/notebook/tests/launchnotebook.py b/notebook/tests/launchnotebook.py index 25ce8c81684..1e6eb025b7e 100644 --- a/notebook/tests/launchnotebook.py +++ b/notebook/tests/launchnotebook.py @@ -16,6 +16,8 @@ from unittest.mock import patch import requests +if os.name != 'nt': + import requests_unixsocket from tornado.ioloop import IOLoop import zmq @@ -230,9 +232,6 @@ def base_url(cls): @staticmethod def fetch_url(url): - # Lazily import so it is not required at the module level - if os.name != 'nt': - import requests_unixsocket with requests_unixsocket.monkeypatch(): return requests.get(url)