We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 3703273 + 67606fd commit 8adca6eCopy full SHA for 8adca6e
binderhub/tests/utils.py
@@ -7,12 +7,21 @@
7
8
import requests
9
from tornado import gen
10
-from tornado.curl_httpclient import CurlAsyncHTTPClient
11
from tornado.httpclient import HTTPError, HTTPRequest, HTTPResponse
12
from tornado.httputil import HTTPHeaders
13
+try:
14
+ from tornado.curl_httpclient import CurlAsyncHTTPClient
15
-class MockAsyncHTTPClient(CurlAsyncHTTPClient):
16
+ BASE_HTTP_CLIENT = CurlAsyncHTTPClient
17
+except ModuleNotFoundError:
18
+ # pycurl is not installed, use regular asynchttpclient
19
+ from tornado.httpclient import AsyncHTTPClient
20
+
21
+ BASE_HTTP_CLIENT = AsyncHTTPClient
22
23
24
+class MockAsyncHTTPClient(BASE_HTTP_CLIENT):
25
mocks = {}
26
records = {}
27
0 commit comments