-
-
Notifications
You must be signed in to change notification settings - Fork 2k
[behave] Added anottations for four classes #15953
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,18 @@ | ||
| import contextlib | ||
| from _typeshed import Incomplete | ||
| from collections.abc import Callable | ||
| from collections.abc import Callable, Generator | ||
| from contextlib import AbstractContextManager | ||
| from typing import ClassVar, ParamSpec | ||
| from enum import Enum | ||
| from typing import Any, ClassVar, ParamSpec, TypeVar | ||
|
|
||
| _P = ParamSpec("_P") | ||
| _T = TypeVar("_T") | ||
|
|
||
| class ContextMaskWarning(UserWarning): ... | ||
|
|
||
| class ContextMode(Enum): | ||
| BEHAVE = 1 | ||
| USER = 2 | ||
|
|
||
| class Context: | ||
| LAYER_NAMES: ClassVar[list[str]] | ||
|
|
@@ -26,13 +35,74 @@ class Context: | |
| 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): ... | ||
| @staticmethod | ||
| def print_cleanup_error(context, cleanup_func, exception: BaseException) -> None: ... | ||
| @staticmethod | ||
| def ignore_cleanup_error(context, cleanup_func, exception: BaseException) -> None: ... | ||
| def use_with_user_mode(self) -> AbstractContextManager[None]: ... | ||
| def user_mode(self) -> Generator[Incomplete]: ... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If we are refactoring this module, let's remove all
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @sobolevn I have already mentioned that this library missing most of classes stubs. When I create it I will update this file too. |
||
| def execute_steps(self, steps_text: str) -> bool: ... | ||
| def add_cleanup(self, cleanup_func: Callable[_P, Incomplete], *args: _P.args, **kwargs: _P.kwargs) -> None: ... | ||
| @property | ||
| def captured(self): ... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. and here :) |
||
| def attach(self, mime_type: str, data: bytes) -> None: ... | ||
|
|
||
| @contextlib.contextmanager | ||
| def use_context_with_mode(context, mode) -> Generator[None]: ... | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. When adding new annotations, it would be preferable to add types to them :) |
||
| @contextlib.contextmanager | ||
| def scoped_context_layer(context, layer=None) -> Generator[Incomplete]: ... | ||
| def path_getrootdir(path: str) -> str: ... | ||
|
|
||
| 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, features: list[Incomplete] | None = None, step_registry=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=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): ... | ||
| 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) -> 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: ... | ||
Uh oh!
There was an error while loading. Please reload this page.