Exclude solitary line from coverage

It's silly, because Python 3.5 and onwards allows coverage.py to detect
this but otherwise our test coverage will fail.
This commit is contained in:
Ian Stapleton Cordasco 2017-07-16 11:57:49 -05:00
parent 2cdfd8ed33
commit 2723538095
No known key found for this signature in database
GPG Key ID: C9D7A2604B4FCB2A
2 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,5 @@
[report]
exclude_lines =
.* # Python \d.*
.* # nocov: Python \d.*
fail_under = 100

View File

@ -415,7 +415,10 @@ def ensure_components_are_valid(uri, validated_components):
if component in _SUBAUTHORITY_VALIDATORS:
if not subauthority_component_is_valid(uri, component):
invalid_components.add(component)
continue
# Python's peephole optimizer means that while this continue *is*
# actually executed, coverage.py cannot detect that. See also,
# https://bitbucket.org/ned/coveragepy/issues/198/continue-marked-as-not-covered
continue # nocov: Python 2.7, 3.3, 3.4
validator = _COMPONENT_VALIDATORS[component]
if not validator(getattr(uri, component)):