From ce34d82cb45e310c99082d8ecb61cbfadfff6962 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20F=C3=A4hrmann?= Date: Thu, 19 Jul 2018 18:47:23 +0200 Subject: [PATCH] fix skipping tests on 5xx status codes --- test/test_results.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/test/test_results.py b/test/test_results.py index abc64b9e..1790fb62 100644 --- a/test/test_results.py +++ b/test/test_results.py @@ -9,6 +9,7 @@ import os import sys +import re import unittest from gallery_dl import extractor, job, config, exception @@ -67,11 +68,8 @@ class TestExtractorResults(unittest.TestCase): try: tjob.run() except exception.HttpError as exc: - try: - if 500 <= exc.args[0].response.status_code < 600: - self.skipTest(exc) - except AttributeError: - pass + if re.match(r"5\d\d HTTP Error:", str(exc)): + self.skipTest(exc) raise # test archive-id uniqueness