A bit more solid typing for goto_or_help_or_infer

This commit is contained in:
Dave Halter
2026-02-16 22:54:32 +01:00
parent ea09983566
commit 3176c1dcb8
+6 -4
View File
@@ -133,11 +133,13 @@ def goto_or_help(request, Script):
@pytest.fixture(scope='session', params=['goto', 'help', 'infer']) @pytest.fixture(scope='session', params=['goto', 'help', 'infer'])
def goto_or_help_or_infer(request, Script): def goto_or_help_or_infer(request, Script):
def do(code, *args, **kwargs): class GotoOrHelpOrInfer:
return getattr(Script(code), request.param)(*args, **kwargs) def __call__(self, code, *args, **kwargs):
return getattr(Script(code), request.param)(*args, **kwargs)
do.type = request.param # type: ignore[attr-defined] type = request.param
return do
return GotoOrHelpOrInfer()
@pytest.fixture(scope='session', params=['goto', 'complete', 'help']) @pytest.fixture(scope='session', params=['goto', 'complete', 'help'])