File tree Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Expand file tree Collapse file tree 1 file changed +25
-0
lines changed Original file line number Diff line number Diff line change @@ -2401,6 +2401,31 @@ def func2() -> None: ...
24012401 error = "func2" ,
24022402 )
24032403
2404+ @collect_cases
2405+ def test_type_default_protocol (self ) -> Iterator [Case ]:
2406+ yield Case (
2407+ stub = """
2408+ from typing import Protocol
2409+
2410+ class _FormatterClass(Protocol):
2411+ def __call__(self, *, prog: str) -> HelpFormatter: ...
2412+
2413+ class ArgumentParser:
2414+ def __init__(self, formatter_class: _FormatterClass = ...) -> None: ...
2415+
2416+ class HelpFormatter:
2417+ def __init__(self, prog: str, indent_increment: int = 2) -> None: ...
2418+ """ ,
2419+ runtime = """
2420+ class HelpFormatter:
2421+ def __init__(self, prog, indent_increment=2) -> None: ...
2422+
2423+ class ArgumentParser:
2424+ def __init__(self, formatter_class=HelpFormatter): ...
2425+ """ ,
2426+ error = None ,
2427+ )
2428+
24042429
24052430def remove_color_code (s : str ) -> str :
24062431 return re .sub ("\\ x1b.*?m" , "" , s ) # this works!
You can’t perform that action at this time.
0 commit comments