Skip to content

Commit

Permalink
Don't fail tests if pycurl is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
yuvipanda committed Dec 7, 2024
1 parent 3703273 commit 67606fd
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions binderhub/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,21 @@

import requests
from tornado import gen
from tornado.curl_httpclient import CurlAsyncHTTPClient
from tornado.httpclient import HTTPError, HTTPRequest, HTTPResponse
from tornado.httputil import HTTPHeaders

try:
from tornado.curl_httpclient import CurlAsyncHTTPClient

class MockAsyncHTTPClient(CurlAsyncHTTPClient):
BASE_HTTP_CLIENT = CurlAsyncHTTPClient
except ModuleNotFoundError:
# pycurl is not installed, use regular asynchttpclient
from tornado.httpclient import AsyncHTTPClient

BASE_HTTP_CLIENT = AsyncHTTPClient


class MockAsyncHTTPClient(BASE_HTTP_CLIENT):
mocks = {}
records = {}

Expand Down

0 comments on commit 67606fd

Please sign in to comment.