fix skipping tests on 5xx status codes

This commit is contained in:
Mike Fährmann
2018-07-19 18:47:23 +02:00
parent 39f609b4c6
commit ce34d82cb4

View File

@@ -9,6 +9,7 @@
import os import os
import sys import sys
import re
import unittest import unittest
from gallery_dl import extractor, job, config, exception from gallery_dl import extractor, job, config, exception
@@ -67,11 +68,8 @@ class TestExtractorResults(unittest.TestCase):
try: try:
tjob.run() tjob.run()
except exception.HttpError as exc: except exception.HttpError as exc:
try: if re.match(r"5\d\d HTTP Error:", str(exc)):
if 500 <= exc.args[0].response.status_code < 600: self.skipTest(exc)
self.skipTest(exc)
except AttributeError:
pass
raise raise
# test archive-id uniqueness # test archive-id uniqueness