Skip to content

Commit

Permalink
Fix typing
Browse files Browse the repository at this point in the history
TypedDict is not a subclass of `dict`, but it is a subclass of `Mapping`. Go figure.
  • Loading branch information
youtux committed Dec 8, 2024
1 parent 0d1c46b commit d4a5271
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pytest_bdd/gherkin_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import re
import textwrap
import typing
from collections.abc import Sequence
from collections.abc import Mapping, Sequence
from dataclasses import dataclass, field
from typing import Any

Expand Down Expand Up @@ -297,7 +297,7 @@ class GherkinDocument:
comments: list[Comment]

@classmethod
def from_dict(cls, data: dict[str, Any]) -> Self:
def from_dict(cls, data: Mapping[str, Any]) -> Self:
return cls(
feature=Feature.from_dict(data["feature"]),
comments=[Comment.from_dict(comment) for comment in data["comments"]],
Expand Down

0 comments on commit d4a5271

Please sign in to comment.