Skip to content

Commit d4a5271

Browse files
committed
Fix typing
TypedDict is not a subclass of `dict`, but it is a subclass of `Mapping`. Go figure.
1 parent 0d1c46b commit d4a5271

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pytest_bdd/gherkin_parser.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import re
55
import textwrap
66
import typing
7-
from collections.abc import Sequence
7+
from collections.abc import Mapping, Sequence
88
from dataclasses import dataclass, field
99
from typing import Any
1010

@@ -297,7 +297,7 @@ class GherkinDocument:
297297
comments: list[Comment]
298298

299299
@classmethod
300-
def from_dict(cls, data: dict[str, Any]) -> Self:
300+
def from_dict(cls, data: Mapping[str, Any]) -> Self:
301301
return cls(
302302
feature=Feature.from_dict(data["feature"]),
303303
comments=[Comment.from_dict(comment) for comment in data["comments"]],

0 commit comments

Comments
 (0)