diff --git a/src/calibre/srv/tests/auth.py b/src/calibre/srv/tests/auth.py index 34652436a7..3580862472 100644 --- a/src/calibre/srv/tests/auth.py +++ b/src/calibre/srv/tests/auth.py @@ -10,6 +10,7 @@ import subprocess import time from collections import namedtuple +from calibre.constants import ismacos from calibre.ptempfile import TemporaryDirectory from calibre.srv.errors import HTTPForbidden from calibre.srv.routes import Router, endpoint @@ -21,6 +22,7 @@ from polyglot.http_cookie import CookieJar from polyglot.urllib import HTTPBasicAuthHandler, HTTPCookieProcessor, HTTPDigestAuthHandler, HTTPError, build_opener REALM = 'calibre-test' +is_ci = os.environ.get('CI', '').lower() == 'true' @endpoint('/open', auth_required=False) @@ -232,7 +234,7 @@ class TestAuth(BaseTest): # Check using curl curl = shutil.which('curl') - if curl: + if curl and not (is_ci and ismacos): # curl mysteriously returns b'' in CI with no errors def docurl(data, *args): cmd = [curl, '--silent'] + list(args) + ['http://localhost:%d/closed' % server.address[1]] p = subprocess.Popen(cmd, stdin=subprocess.DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE)