Make URL differences non-fatal in module tests

This commit is contained in:
Tobias Gruetzmacher 2020-09-26 23:08:00 +02:00
parent 193b3da801
commit 3ac8f703bd

View file

@ -4,6 +4,7 @@
# Copyright (C) 2015-2020 Tobias Gruetzmacher
import re
import multiprocessing
import warnings
from urllib.parse import urlsplit
@ -106,6 +107,6 @@ def _check_stripurl(strip, scraperobj):
urlmatch = ARCHIVE_ORG_MATCH.sub(r'/\\d+/', urlmatch)
ro = re.compile(urlmatch)
mo = ro.match(strip.strip_url)
err = 'strip URL {!r} does not match stripUrl pattern {}'.format(
strip.strip_url, urlmatch)
assert mo is not None, err
if not mo:
warnings.warn('strip URL {!r} does not match stripUrl pattern {}'.format(
strip.strip_url, urlmatch))