diff --git a/stubs/behave/behave/__init__.pyi b/stubs/behave/behave/__init__.pyi index 70422a43ef94..2713dfa1b37e 100644 --- a/stubs/behave/behave/__init__.pyi +++ b/stubs/behave/behave/__init__.pyi @@ -1,3 +1,9 @@ +from behave.api.step_matchers import ( + register_type as register_type, + step_matcher as step_matcher, + use_default_step_matcher as use_default_step_matcher, + use_step_matcher as use_step_matcher, +) from behave.fixture import fixture as fixture, use_fixture as use_fixture from behave.step_registry import ( Given as Given, @@ -10,4 +16,19 @@ from behave.step_registry import ( when as when, ) -__all__ = ["given", "when", "then", "step", "Given", "When", "Then", "Step", "use_fixture", "fixture"] +__all__ = [ + "given", + "when", + "then", + "step", + "Given", + "When", + "Then", + "Step", + "use_default_step_matcher", + "use_step_matcher", + "register_type", + "fixture", + "use_fixture", + "step_matcher", +] diff --git a/stubs/behave/behave/api/__init__.pyi b/stubs/behave/behave/api/__init__.pyi new file mode 100644 index 000000000000..e69de29bb2d1 diff --git a/stubs/behave/behave/api/step_matchers.pyi b/stubs/behave/behave/api/step_matchers.pyi new file mode 100644 index 000000000000..20a69f50296a --- /dev/null +++ b/stubs/behave/behave/api/step_matchers.pyi @@ -0,0 +1,10 @@ +from collections.abc import Callable +from typing import Any +from typing_extensions import deprecated + +# The converter can return any type and behave passes the result straight to the step function. +def register_type(**kwargs: Callable[[str], Any]) -> None: ... +def use_default_step_matcher(name: str | None = None): ... +def use_step_matcher(name: str): ... +@deprecated("Use use_step_matcher() instead.") +def step_matcher(name: str): ...