Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions ietf/utils/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,11 @@

class UrlCoverageWarning(UserWarning):
"""Warning category for URL coverage-related warnings"""
pass
# URLs for which we don't expect patterns to match
IGNORE_URLS = (
"/_doesnotexist/",
"/sitemap.xml.",
)


class UninterestingPatternWarning(UrlCoverageWarning):
Expand Down Expand Up @@ -581,9 +585,10 @@ def ignore_pattern(regex, pattern):
try:
resolved = resolve(url) # let Django resolve the URL for us
except Resolver404:
warnings.warn(
f"Unable to resolve visited URL {url}", UrlCoverageWarning
)
if url not in UrlCoverageWarning.IGNORE_URLS:
warnings.warn(
f"Unable to resolve visited URL {url}", UrlCoverageWarning
)
continue
if resolved.route not in patterns:
warnings.warn(
Expand Down
Loading