Skip to content

Commit

Permalink
fix type for StepFunctionContext.converters
Browse files Browse the repository at this point in the history
  • Loading branch information
youtux authored Dec 2, 2023
1 parent 4508b98 commit 9c60589
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/pytest_bdd/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class StepFunctionContext:
type: Literal["given", "when", "then"] | None
step_func: Callable[..., Any]
parser: StepParser
converters: dict[str, Callable[..., Any]] = field(default_factory=dict)
converters: dict[str, Callable[[str], Any]] = field(default_factory=dict)
target_fixture: str | None = None


Expand All @@ -76,7 +76,7 @@ def get_step_fixture_name(step: Step) -> str:

def given(
name: str | StepParser,
converters: dict[str, Callable[[Any], Any]] | None = None,
converters: dict[str, Callable[[str], Any]] | None = None,
target_fixture: str | None = None,
stacklevel: int = 1,
) -> Callable[[Callable[P, T]], Callable[P, T]]:
Expand All @@ -95,7 +95,7 @@ def given(

def when(
name: str | StepParser,
converters: dict[str, Callable[[Any], Any]] | None = None,
converters: dict[str, Callable[[str], Any]] | None = None,
target_fixture: str | None = None,
stacklevel: int = 1,
) -> Callable[[Callable[P, T]], Callable[P, T]]:
Expand All @@ -114,7 +114,7 @@ def when(

def then(
name: str | StepParser,
converters: dict[str, Callable[[Any], Any]] | None = None,
converters: dict[str, Callable[[str], Any]] | None = None,
target_fixture: str | None = None,
stacklevel: int = 1,
) -> Callable[[Callable[P, T]], Callable[P, T]]:
Expand All @@ -134,7 +134,7 @@ def then(
def step(
name: str | StepParser,
type_: Literal["given", "when", "then"] | None = None,
converters: dict[str, Callable[[Any], Any]] | None = None,
converters: dict[str, Callable[[str], Any]] | None = None,
target_fixture: str | None = None,
stacklevel: int = 1,
) -> Callable[[Callable[P, T]], Callable[P, T]]:
Expand Down

0 comments on commit 9c60589

Please sign in to comment.