Skip to content

Commit 91ce180

Browse files
committed
fix: Add runtime_checkable to Parser protocol
- Add runtime_checkable decorator to Parser protocol - Add explicit parser marker to shell parser integration test - Ensure protocol can be used for runtime type checking
1 parent fbc67c7 commit 91ce180

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

src/cli_patterns/ui/parser/protocols.py

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,3 @@ def get_suggestions(self, partial: str) -> list[str]:
5454
List of suggested completions for the partial input
5555
"""
5656
...
57-
58-
59-
# Explicitly set the runtime checkable attribute for older Python versions
60-
Parser.__runtime_checkable__ = True

tests/integration/test_shell_parser_integration.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,8 @@
2323
# Import shell and parser components
2424
from cli_patterns.ui.shell import InteractiveShell
2525

26+
pytestmark = pytest.mark.parser
27+
2628

2729
class TestShellParserIntegration:
2830
"""Integration tests for shell and parser system working together."""

0 commit comments

Comments
 (0)