Skip to content

Commit

Permalink
Add #pragma: no cover to final line missing coverage, as well as a …
Browse files Browse the repository at this point in the history
…comment for justification.
  • Loading branch information
Sachaa-Thanasius committed Jul 3, 2024
1 parent 6a4daf3 commit 1443cd1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/rfc3986/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,11 @@ def subauthority_component_is_valid(
return True

# We know it has to have fewer than 6 digits if it exists.
if not (port.isdigit() and len(port) < 6):
if not (port.isdigit() and len(port) < 6): # pragma: no cover
# This branch can only execute when this function is called directly
# with a URI reference manually constructed with an invalid port.
# Such a use case is unsupported, since this function isn't part of
# the public API.
return False

return 0 <= int(port) <= 65535
Expand Down

0 comments on commit 1443cd1

Please sign in to comment.