Skip to content

Commit 1443cd1

Browse files
Add #pragma: no cover to final line missing coverage, as well as a comment for justification.
1 parent 6a4daf3 commit 1443cd1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/rfc3986/validators.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -443,7 +443,11 @@ def subauthority_component_is_valid(
443443
return True
444444

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

449453
return 0 <= int(port) <= 65535

0 commit comments

Comments
 (0)