From 3176c1dcb87abd529009da0c01e0cad50b08110c Mon Sep 17 00:00:00 2001 From: Dave Halter Date: Mon, 16 Feb 2026 22:54:32 +0100 Subject: [PATCH] A bit more solid typing for goto_or_help_or_infer --- conftest.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/conftest.py b/conftest.py index 86ce7b5e..d7c96845 100644 --- a/conftest.py +++ b/conftest.py @@ -133,11 +133,13 @@ def goto_or_help(request, Script): @pytest.fixture(scope='session', params=['goto', 'help', 'infer']) def goto_or_help_or_infer(request, Script): - def do(code, *args, **kwargs): - return getattr(Script(code), request.param)(*args, **kwargs) + class GotoOrHelpOrInfer: + def __call__(self, code, *args, **kwargs): + return getattr(Script(code), request.param)(*args, **kwargs) - do.type = request.param # type: ignore[attr-defined] - return do + type = request.param + + return GotoOrHelpOrInfer() @pytest.fixture(scope='session', params=['goto', 'complete', 'help'])