From 3cff66d591bbc983a438cf4fd8b1a727a0d61281 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=92=D0=BB=D0=B0=D0=B4=D0=B8=D1=81=D0=BB=D0=B0=D0=B2=20?= =?UTF-8?q?=D0=98=D0=B2=D1=87=D0=B5=D0=BD=D0=BA=D0=BE=D0=B2?= Date: Sat, 27 Jun 2026 03:55:14 +0300 Subject: [PATCH 1/2] Added anottations for four classes --- stubs/behave/behave/runner.pyi | 65 ++++++++++++++++++++++++++++++++-- 1 file changed, 62 insertions(+), 3 deletions(-) diff --git a/stubs/behave/behave/runner.pyi b/stubs/behave/behave/runner.pyi index a3abfa2d0de2..954090a0f803 100644 --- a/stubs/behave/behave/runner.pyi +++ b/stubs/behave/behave/runner.pyi @@ -1,9 +1,18 @@ from _typeshed import Incomplete from collections.abc import Callable from contextlib import AbstractContextManager -from typing import ClassVar, ParamSpec +from typing import ClassVar, ParamSpec, Any, TypeVar +from enum import Enum _P = ParamSpec("_P") +_T = TypeVar("_T") + +class ContextMaskWarning(UserWarning): ... + +class ContextMode(Enum): + BEHAVE = 1 + USER = 2 + class Context: LAYER_NAMES: ClassVar[list[str]] @@ -20,13 +29,13 @@ class Context: active_outline: Incomplete fail_on_cleanup_errors: bool - def __init__(self, runner) -> None: ... + def __init__(self, runner: Incomplete) -> None: ... def __getattr__(self, name: str) -> Incomplete: ... def __setattr__(self, name: str, value) -> None: ... def __delattr__(self, name: str) -> None: ... def __contains__(self, name: str) -> bool: ... def abort(self, reason: str | None = None) -> None: ... - def use_or_assign_param(self, name: str, value): ... + def use_or_assign_param(self, name: str, value: _T) -> _T | None: ... def use_or_create_param(self, name: str, factory_func: Callable[_P, Incomplete], *args: _P.args, **kwargs: _P.kwargs): ... def use_with_user_mode(self) -> AbstractContextManager[None]: ... def execute_steps(self, steps_text: str) -> bool: ... @@ -35,4 +44,54 @@ class Context: def captured(self): ... def attach(self, mime_type: str, data: bytes) -> None: ... + +class ModelRunner: + config: Incomplete + features: Incomplete + hooks: Incomplete + formatters: Incomplete + step_registry: Incomplete + capture_controller: Incomplete + capture_sink: Incomplete + context: Incomplete + feature: Incomplete + hook_failures: int + def __init__(self, config: Incomplete, features: list[Incomplete] | None=None, step_registry: Incomplete | None=None) -> None: ... + @property + def undefined_steps(self) -> list[Incomplete]: ... + @property + def aborted(self) -> bool: ... + @aborted.setter + def aborted(self, value) -> None: ... + def abort(self, reason: str | None = None) -> None: ... + def should_run_hook(self, hook_name: str) -> bool: ... + def run_hook(self, hook_name: str, *args: Any) -> None: ... + def should_capture_hook(self, hook_name: str) -> bool: ... + def run_hook_with_capture(self, hook_name: str, *args: str, **kwargs: str) -> bool: ... + def run_hook_tags(self, hook_name: str, tags: list[str]) -> bool: ... + def run_hook_tags_with_capture(self, hook_name: str, tags: list[str], capture_sink: Incomplete | None=None) -> bool: ... + def setup_capture(self, name: str | None = None) -> None: ... + def start_capture(self) -> None: ... + def stop_capture(self) -> None: ... + def teardown_capture(self) -> None: ... + @property + def captured(self) -> Incomplete: ... + def run_model(self, features: list[Incomplete] | None = None) -> bool: ... + def run(self) -> bool: ... + +class Runner(ModelRunner): + DEFAULT_DIRECTORY: str + path_manager: Incomplete + base_dir: Incomplete + + def __init__(self, config: Incomplete) -> None: ... + def setup_paths(self) -> None: ... + def before_all_default_hook(self, context: Context) -> None: ... + def load_hooks(self, filename: str | None = None) -> None: ... + def load_step_definitions(self, extra_step_paths: list[str] | None =None) -> None: ... + def feature_locations(self) -> list[str]: ... + def run(self) -> bool: ... + def run_with_paths(self) -> bool: ... + + def __getattr__(name: str) -> Incomplete: ... From 028be4b6f9d0268de5a6b4b8777ea2e923436e93 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 27 Jun 2026 01:07:06 +0000 Subject: [PATCH 2/2] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stubs/behave/behave/runner.pyi | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/stubs/behave/behave/runner.pyi b/stubs/behave/behave/runner.pyi index 954090a0f803..a557fdd94a59 100644 --- a/stubs/behave/behave/runner.pyi +++ b/stubs/behave/behave/runner.pyi @@ -1,8 +1,8 @@ from _typeshed import Incomplete from collections.abc import Callable from contextlib import AbstractContextManager -from typing import ClassVar, ParamSpec, Any, TypeVar from enum import Enum +from typing import Any, ClassVar, ParamSpec, TypeVar _P = ParamSpec("_P") _T = TypeVar("_T") @@ -13,7 +13,6 @@ class ContextMode(Enum): BEHAVE = 1 USER = 2 - class Context: LAYER_NAMES: ClassVar[list[str]] FAIL_ON_CLEANUP_ERRORS: ClassVar[bool] @@ -44,7 +43,6 @@ class Context: def captured(self): ... def attach(self, mime_type: str, data: bytes) -> None: ... - class ModelRunner: config: Incomplete features: Incomplete @@ -56,20 +54,24 @@ class ModelRunner: context: Incomplete feature: Incomplete hook_failures: int - def __init__(self, config: Incomplete, features: list[Incomplete] | None=None, step_registry: Incomplete | None=None) -> None: ... + def __init__( + self, config: Incomplete, features: list[Incomplete] | None = None, step_registry: Incomplete | None = None + ) -> None: ... @property def undefined_steps(self) -> list[Incomplete]: ... + @property def aborted(self) -> bool: ... @aborted.setter def aborted(self, value) -> None: ... + def abort(self, reason: str | None = None) -> None: ... def should_run_hook(self, hook_name: str) -> bool: ... def run_hook(self, hook_name: str, *args: Any) -> None: ... - def should_capture_hook(self, hook_name: str) -> bool: ... + def should_capture_hook(self, hook_name: str) -> bool: ... def run_hook_with_capture(self, hook_name: str, *args: str, **kwargs: str) -> bool: ... def run_hook_tags(self, hook_name: str, tags: list[str]) -> bool: ... - def run_hook_tags_with_capture(self, hook_name: str, tags: list[str], capture_sink: Incomplete | None=None) -> bool: ... + def run_hook_tags_with_capture(self, hook_name: str, tags: list[str], capture_sink: Incomplete | None = None) -> bool: ... def setup_capture(self, name: str | None = None) -> None: ... def start_capture(self) -> None: ... def stop_capture(self) -> None: ... @@ -88,10 +90,9 @@ class Runner(ModelRunner): def setup_paths(self) -> None: ... def before_all_default_hook(self, context: Context) -> None: ... def load_hooks(self, filename: str | None = None) -> None: ... - def load_step_definitions(self, extra_step_paths: list[str] | None =None) -> None: ... + def load_step_definitions(self, extra_step_paths: list[str] | None = None) -> None: ... def feature_locations(self) -> list[str]: ... def run(self) -> bool: ... def run_with_paths(self) -> bool: ... - def __getattr__(name: str) -> Incomplete: ...