Skip to content

Commit 8860735

Browse files
committed
Apply suggestions from code review (__getattr__, ClassVar)
Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de> fix: use ClassVar Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de> Apply suggestions from code review Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de> Apply suggestions from code review Co-authored-by: Sebastian Rittau <sebastian.rittau@zfutura.de> fix: add missing imports
1 parent a31fef0 commit 8860735

File tree

2 files changed

+16
-10
lines changed

2 files changed

+16
-10
lines changed

stubs/behave/behave/runner.pyi

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,24 @@
11
from _typeshed import Incomplete
22
from collections.abc import Callable
33
from contextlib import AbstractContextManager
4-
from typing import ParamSpec
4+
from typing import ClassVar, ParamSpec
55

66
_P = ParamSpec("_P")
77

88
class Context:
9-
LAYER_NAMES: list[str]
10-
FAIL_ON_CLEANUP_ERRORS: bool
9+
LAYER_NAMES: ClassVar[list[str]]
10+
FAIL_ON_CLEANUP_ERRORS: ClassVar[bool]
1111

12-
feature: Incomplete
12+
feature: Incomplete | None
1313
scenario: Incomplete
1414
tags: set[str]
1515
aborted: bool
1616
failed: bool
17-
table: Incomplete
17+
table: Incomplete | None
1818
text: str | None
1919
config: Incomplete
2020
active_outline: Incomplete
21+
fail_on_cleanup_errors: bool
2122

2223
def __init__(self, runner) -> None: ...
2324
def __getattr__(self, name: str) -> Incomplete: ...
@@ -33,3 +34,5 @@ class Context:
3334
@property
3435
def captured(self): ...
3536
def attach(self, mime_type: str, data: bytes) -> None: ...
37+
38+
def __getattr__(name: str) -> Incomplete: ...
Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
1+
from _typeshed import Incomplete
12
from collections.abc import Callable
2-
from typing import Any, Concatenate, TypeVar
3+
from typing import Concatenate, TypeVar
34

45
from behave.runner import Context
56

67
_F = TypeVar("_F", bound=Callable[Concatenate[Context, ...], None])
78

8-
def given(step_text: str, **kwargs: Any) -> Callable[[_F], _F]: ...
9-
def when(step_text: str, **kwargs: Any) -> Callable[[_F], _F]: ...
10-
def then(step_text: str, **kwargs: Any) -> Callable[[_F], _F]: ...
11-
def step(step_text: str, **kwargs: Any) -> Callable[[_F], _F]: ...
9+
def given(step_text: str, **kwargs) -> Callable[[_F], _F]: ...
10+
def when(step_text: str, **kwargs) -> Callable[[_F], _F]: ...
11+
def then(step_text: str, **kwargs) -> Callable[[_F], _F]: ...
12+
def step(step_text: str, **kwargs) -> Callable[[_F], _F]: ...
1213

1314
# Title-case aliases
1415
Given = given
1516
When = when
1617
Then = then
1718
Step = step
19+
20+
def __getattr__(name: str) -> Incomplete: ...

0 commit comments

Comments
 (0)