Make URL differences non-fatal in module tests
This commit is contained in:
parent
193b3da801
commit
3ac8f703bd
1 changed files with 4 additions and 3 deletions
|
@ -4,6 +4,7 @@
|
||||||
# Copyright (C) 2015-2020 Tobias Gruetzmacher
|
# Copyright (C) 2015-2020 Tobias Gruetzmacher
|
||||||
import re
|
import re
|
||||||
import multiprocessing
|
import multiprocessing
|
||||||
|
import warnings
|
||||||
from urllib.parse import urlsplit
|
from urllib.parse import urlsplit
|
||||||
|
|
||||||
|
|
||||||
|
@ -106,6 +107,6 @@ def _check_stripurl(strip, scraperobj):
|
||||||
urlmatch = ARCHIVE_ORG_MATCH.sub(r'/\\d+/', urlmatch)
|
urlmatch = ARCHIVE_ORG_MATCH.sub(r'/\\d+/', urlmatch)
|
||||||
ro = re.compile(urlmatch)
|
ro = re.compile(urlmatch)
|
||||||
mo = ro.match(strip.strip_url)
|
mo = ro.match(strip.strip_url)
|
||||||
err = 'strip URL {!r} does not match stripUrl pattern {}'.format(
|
if not mo:
|
||||||
strip.strip_url, urlmatch)
|
warnings.warn('strip URL {!r} does not match stripUrl pattern {}'.format(
|
||||||
assert mo is not None, err
|
strip.strip_url, urlmatch))
|
||||||
|
|
Loading…
Reference in a new issue