Skip to content

clean up most OptionalExtensionNotSupported - #340

Merged
slingamn merged 2 commits into
progval:masterfrom
slingamn:behavior
Feb 8, 2026
Merged

slingamn merged 2 commits into
progval:masterfrom
slingamn:behavior

Conversation

@slingamn

@slingamn slingamn commented Feb 8, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes the bug in #336 where it raised OptionalExtensionNotSupported (which is unchecked) instead of OptionalBehaviorNotSupported (which takes an enum and is checked against the controller's set of supported optional behaviors).

I think ultimately we should get rid of OptionalExtensionNotSupported because of its potential for confusion. The strategy here is:

  1. If it's a relatively standard optional behavior, add an OptionalBehaviors enum for it and use OptionalBehaviorNotSupported
  2. If it's a weird special case (like Bahamut not supporting common behaviors) just throw an ad-hoc unittest.SkipTest

Some cases I couldn't figure out:

  1. ELIST in irctest/server_tests/list.py (but here I would lean towards biting the bullet and creating separate enums for, e.g. ELIST_M, ELIST_U).
  2. "Multi-target WHOWAS" (which implementations actually support this?)
  3. testDoubleKickMessages has an exception for ircds that don't automatically op the channel creator; I think this behavior is weird enough that we should explicitly exempt those ircds by controller name

@progval

progval commented Feb 8, 2026

Copy link
Copy Markdown
Owner
  • If it's a relatively standard optional behavior, add an OptionalBehaviors enum for it and use OptionalBehaviorNotSupported
  • If it's a weird special case (like Bahamut not supporting common behaviors) just throw an ad-hoc unittest.SkipTest

Ok, but with an extra step: we fix specs to be MAY in the first case and SHOULD in the second case; and then make irctest use either OptionalBehaviorNotSupported or unittest.SkipTest/xfail based on that

"Multi-target WHOWAS" (which implementations actually support this?)

According to https://dashboard.irctest.limnoria.net/irctest.server_tests.whowas.xhtml , none.

testDoubleKickMessages has an exception for ircds that don't automatically op the channel creator

can't we remove that?

Comment thread irctest/runner.py Resolved
Co-authored-by: Val Lorentz <progval+github@progval.net>
@slingamn
slingamn merged commit 71ca983 into progval:master Feb 8, 2026
38 of 40 checks passed
@slingamn
slingamn deleted the behavior branch February 8, 2026 10:18
slingamn added a commit to slingamn/irctest that referenced this pull request Feb 9, 2026
This is a bug in progval#340. If we pass reason.value instead of reason to
the unittest.SkipTest constructor, pytest_runtest_call will never see
the exception argument as an element of self.controller.optional_behaviors,
resulting in the test being skipped even when it shouldn't.
slingamn added a commit that referenced this pull request Feb 9, 2026
This is a bug in #340. If we pass reason.value instead of reason to
the unittest.SkipTest constructor, pytest_runtest_call will never see
the exception argument as an element of self.controller.optional_behaviors,
resulting in the test being skipped even when it shouldn't be.
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.

2 participants