diff --git a/lib/iris/tests/test_image_json.py b/lib/iris/tests/test_image_json.py index d767245a84..ae144ce3f6 100644 --- a/lib/iris/tests/test_image_json.py +++ b/lib/iris/tests/test_image_json.py @@ -35,7 +35,7 @@ from threading import Thread # maximum number of threads for multi-threading code -MAXTHREADS = 128 +MAXTHREADS = 8 # Turn down requests logging logging.getLogger("requests").setLevel(logging.CRITICAL) @@ -58,8 +58,7 @@ def run(self): resource = self.queue.get() try: result = requests.head(resource) - if (result.status_code == 200 and - resource.startswith('https://scitools.github.io')): + if result.status_code == 200: self.deque.append(resource) else: msg = '{} is not resolving correctly.'.format(resource) @@ -80,7 +79,11 @@ def test_resolve(self): exceptions = deque() uri_queue = Queue() for uri in uris: - uri_queue.put(uri) + if uri.startswith('https://scitools.github.io'): + uri_queue.put(uri) + else: + msg = '{} is not a valid resource.'.format(uri) + exceptions.append(ValueError(msg)) for i in range(MAXTHREADS): _ResolveWorkerThread(uri_queue, uri_list, exceptions).start()