Skip to content

Commit 06bc96e

Browse files
committed
Require future annotations import for tests (I002)
- Applied through ruff `--fix` - Subsequently simplified optional in `tests/feature/test_report.py`
1 parent f5eedc9 commit 06bc96e

37 files changed

+72
-14
lines changed

docs/conf.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55

66
# -- Project information -----------------------------------------------------
77
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
from __future__ import annotations
89

910
from importlib import metadata as _metadata
1011

pyproject.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,6 @@ lint.isort.required-imports = [
7373
"from __future__ import annotations",
7474
]
7575

76-
[tool.ruff.lint.per-file-ignores]
77-
# Lint `I002` (required imports) for `from __future__ import annotations` in `src/`
78-
"!src/**.py" = ["I002"]
79-
8076
[tool.coverage.report]
8177
exclude_lines = [
8278
"if TYPE_CHECKING:",

tests/args/cfparse/test_args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Step arguments tests."""
22

3+
from __future__ import annotations
4+
35
import textwrap
46

57

tests/args/parse/test_args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Step arguments tests."""
22

3+
from __future__ import annotations
4+
35
import textwrap
46

57

tests/args/regex/test_args.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Step arguments tests."""
22

3+
from __future__ import annotations
4+
35
import textwrap
46

57

tests/args/test_common.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import textwrap
24

35
from pytest_bdd.utils import collect_dumped_objects

tests/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import pytest
24

35
pytest_plugins = "pytester"

tests/datatable/test_datatable.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
import textwrap
24

35
from src.pytest_bdd.utils import collect_dumped_objects

tests/feature/test_alias.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Test step alias when decorated multiple times."""
22

3+
from __future__ import annotations
4+
35
import textwrap
46

57

tests/feature/test_background.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
"""Test feature background."""
22

3+
from __future__ import annotations
4+
35
import textwrap
46

57
FEATURE = '''\

0 commit comments

Comments
 (0)