Skip to content

Commit a41887d

Browse files
committed
run pre-commit --all-files and remove unused imports
1 parent 590007a commit a41887d

File tree

6 files changed

+14
-9
lines changed

6 files changed

+14
-9
lines changed

src/pytest_bdd/generation.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
from .types import STEP_TYPES
1717

1818
if TYPE_CHECKING:
19-
from typing import Any, Sequence
19+
from collections.abc import Sequence
20+
from typing import Any
2021

2122
from _pytest.config import Config
2223
from _pytest.config.argparsing import Parser

src/pytest_bdd/parser.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,13 @@
44
import re
55
import textwrap
66
from collections import OrderedDict
7+
from collections.abc import Iterable, Mapping, Sequence
78
from dataclasses import dataclass, field
8-
from typing import Any, Dict, Iterable, List, Mapping, Optional, Sequence
9+
from typing import Any
910

1011
from .exceptions import StepError
1112
from .gherkin_parser import Background as GherkinBackground
12-
from .gherkin_parser import DataTable, ExamplesTable
13+
from .gherkin_parser import DataTable
1314
from .gherkin_parser import Feature as GherkinFeature
1415
from .gherkin_parser import GherkinDocument
1516
from .gherkin_parser import Scenario as GherkinScenario

src/pytest_bdd/parsers.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
import abc
66
import re as base_re
7-
from typing import Any, Dict, TypeVar, cast, overload
7+
from typing import Any, TypeVar, cast, overload
88

99
import parse as base_parse
1010
from parse_type import cfparse as base_cfparse
@@ -66,7 +66,7 @@ def parse_arguments(self, name: str) -> dict[str, Any]:
6666
6767
:return: `dict` of step arguments
6868
"""
69-
return cast(Dict[str, Any], self.parser.parse(name).named)
69+
return cast(dict[str, Any], self.parser.parse(name).named)
7070

7171
def is_matching(self, name: str) -> bool:
7272
"""Match given name with the step name."""

src/pytest_bdd/plugin.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from __future__ import annotations
44

5-
from typing import TYPE_CHECKING, Any, Callable, Generator, TypeVar, cast
5+
from collections.abc import Generator
6+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
67

78
import pytest
89
from typing_extensions import ParamSpec

src/pytest_bdd/scenario.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@
1717
import logging
1818
import os
1919
import re
20-
from typing import TYPE_CHECKING, Any, Callable, Iterable, Iterator, List, TypeVar, cast
20+
from collections.abc import Iterable, Iterator
21+
from typing import TYPE_CHECKING, Any, Callable, TypeVar, cast
2122

2223
import pytest
2324
from _pytest.fixtures import FixtureDef, FixtureManager, FixtureRequest, call_fixture_func
@@ -62,7 +63,7 @@ def find_fixturedefs_for_step(step: Step, fixturemanager: FixtureManager, node:
6263
if not match:
6364
continue
6465

65-
fixturedefs = cast(List[FixtureDef[Any]], getfixturedefs(fixturemanager, fixturename, node) or [])
66+
fixturedefs = cast(list[FixtureDef[Any]], getfixturedefs(fixturemanager, fixturename, node) or [])
6667
if fixturedef not in fixturedefs:
6768
continue
6869

src/pytest_bdd/steps.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ def _(article):
3838
from __future__ import annotations
3939

4040
import enum
41+
from collections.abc import Iterable
4142
from dataclasses import dataclass, field
4243
from itertools import count
43-
from typing import Any, Callable, Iterable, Literal, TypeVar
44+
from typing import Any, Callable, Literal, TypeVar
4445

4546
import pytest
4647
from typing_extensions import ParamSpec

0 commit comments

Comments
 (0)