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 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