Prevent inclusion of requests_unixsocket on Windows (#5650)

* Prevent inclusion of requests_unixsocket on Windows

* lazily import

Co-authored-by: Steven Silvester <stslve@amazon.com>
pull/5657/head
Kevin Bates 6 years ago committed by GitHub
parent a8fbe7df2e
commit 73e6c27369
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -16,7 +16,6 @@ pjoin = os.path.join
from unittest.mock import patch
import requests
import requests_unixsocket
from tornado.ioloop import IOLoop
import zmq
@ -231,6 +230,9 @@ class UNIXSocketNotebookTestBase(NotebookTestBase):
@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)

@ -117,10 +117,9 @@ for more information.
],
extras_require = {
'test': ['nose', 'coverage', 'requests', 'nose_warnings_filters',
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov',
'requests-unixsocket'],
'nbval', 'nose-exclude', 'selenium', 'pytest', 'pytest-cov'],
'docs': ['sphinx', 'nbsphinx', 'sphinxcontrib_github_alt'],
'test:sys_platform == "win32"': ['nose-exclude'],
'test:sys_platform != "win32"': ['requests-unixsocket'],
},
python_requires = '>=3.5',
entry_points = {

Loading…
Cancel
Save