From 59d134343d2221e2d0ebe309636a1ccac74c8154 Mon Sep 17 00:00:00 2001 From: Steven Silvester Date: Mon, 3 Aug 2020 13:03:49 -0500 Subject: [PATCH] Lazily import requests_unixsocket --- notebook/tests/launchnotebook.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/notebook/tests/launchnotebook.py b/notebook/tests/launchnotebook.py index 6a393102d3..a41acbe42f 100644 --- a/notebook/tests/launchnotebook.py +++ b/notebook/tests/launchnotebook.py @@ -16,7 +16,6 @@ from unittest.mock import patch import requests -import requests_unixsocket from tornado.ioloop import IOLoop import zmq @@ -231,6 +230,8 @@ def base_url(cls): @staticmethod def fetch_url(url): + # Lazily import to prevent a hard dependency + import requests_unixsocket with requests_unixsocket.monkeypatch(): return requests.get(url)