Skip to content

Conversation

@dannywillems
Copy link
Contributor

Summary

  • Replace assert 0 <= port < 65536 with raise ValueError(...) in PortField
  • Assertions can be stripped with python -O, silently disabling validation
  • Update tests to expect ValueError instead of AssertionError

Test plan

  • All 70 tests pass
  • PortField(-1) raises ValueError
  • PortField(65536) raises ValueError

Closes #34

@dannywillems dannywillems force-pushed the fix/34-portfield-valueerror branch 2 times, most recently from f7d5605 to 19f9018 Compare February 8, 2026 03:31
Assertions can be stripped with python -O, silently disabling
port range validation. Use ValueError with a descriptive message
instead.

Closes #34
@dannywillems dannywillems force-pushed the fix/34-portfield-valueerror branch from 19f9018 to 8262ad6 Compare February 8, 2026 03:31
@dannywillems dannywillems merged commit 3b796c9 into main Feb 8, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Replace assert with ValueError in PortField validation

1 participant