diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 7859bce5..401105dc 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -3,11 +3,11 @@ repos: - repo: https://github.com/psf/black # If you update the version here, also update it in tox.ini (py*-pytestlatest-linters) - rev: 23.11.0 + rev: 24.2.0 hooks: - id: black - repo: https://github.com/pycqa/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort name: isort (python) @@ -19,7 +19,7 @@ repos: - id: check-yaml - id: check-added-large-files - repo: https://github.com/asottile/pyupgrade - rev: v3.15.0 + rev: v3.15.1 hooks: - id: pyupgrade args: ["--py38-plus"] diff --git a/src/pytest_bdd/__init__.py b/src/pytest_bdd/__init__.py index aeaeb747..f5078b97 100644 --- a/src/pytest_bdd/__init__.py +++ b/src/pytest_bdd/__init__.py @@ -1,4 +1,5 @@ """pytest-bdd public API.""" + from __future__ import annotations from pytest_bdd.scenario import scenario, scenarios diff --git a/src/pytest_bdd/cucumber_json.py b/src/pytest_bdd/cucumber_json.py index 60a3e84d..ab0c4a98 100644 --- a/src/pytest_bdd/cucumber_json.py +++ b/src/pytest_bdd/cucumber_json.py @@ -1,4 +1,5 @@ """Cucumber json output formatter.""" + from __future__ import annotations import json @@ -46,7 +47,6 @@ def unconfigure(config: Config) -> None: class LogBDDCucumberJSON: - """Logging plugin for cucumber like json output.""" def __init__(self, logfile: str) -> None: diff --git a/src/pytest_bdd/exceptions.py b/src/pytest_bdd/exceptions.py index 46581979..a7bf60ff 100644 --- a/src/pytest_bdd/exceptions.py +++ b/src/pytest_bdd/exceptions.py @@ -1,4 +1,5 @@ """pytest-bdd Exceptions.""" + from __future__ import annotations diff --git a/src/pytest_bdd/feature.py b/src/pytest_bdd/feature.py index 733d1196..54a15e3a 100644 --- a/src/pytest_bdd/feature.py +++ b/src/pytest_bdd/feature.py @@ -23,6 +23,7 @@ :note: There are no multiline steps, the description of the step must fit in one line. """ + from __future__ import annotations import glob diff --git a/src/pytest_bdd/generation.py b/src/pytest_bdd/generation.py index be4212f8..bfde4a9b 100644 --- a/src/pytest_bdd/generation.py +++ b/src/pytest_bdd/generation.py @@ -1,4 +1,5 @@ """pytest-bdd missing test code generation.""" + from __future__ import annotations import itertools diff --git a/src/pytest_bdd/parsers.py b/src/pytest_bdd/parsers.py index 0ae16705..9c53a55a 100644 --- a/src/pytest_bdd/parsers.py +++ b/src/pytest_bdd/parsers.py @@ -1,4 +1,5 @@ """Step parsers.""" + from __future__ import annotations import abc @@ -103,13 +104,11 @@ def is_matching(self, name: str) -> bool: @overload -def get_parser(step_name: str) -> string: - ... +def get_parser(step_name: str) -> string: ... @overload -def get_parser(step_name: TStepParser) -> TStepParser: - ... +def get_parser(step_name: TStepParser) -> TStepParser: ... def get_parser(step_name: str | StepParser) -> StepParser: diff --git a/src/pytest_bdd/plugin.py b/src/pytest_bdd/plugin.py index d087802b..96ab7a85 100644 --- a/src/pytest_bdd/plugin.py +++ b/src/pytest_bdd/plugin.py @@ -1,4 +1,5 @@ """Pytest plugin entry point. Used for any fixtures needed.""" + from __future__ import annotations from typing import TYPE_CHECKING, Any, Callable, Generator, TypeVar, cast diff --git a/src/pytest_bdd/reporting.py b/src/pytest_bdd/reporting.py index 95254f64..f0a3d014 100644 --- a/src/pytest_bdd/reporting.py +++ b/src/pytest_bdd/reporting.py @@ -3,6 +3,7 @@ Collection of the scenario execution statuses, timing and other information that enriches the pytest test reporting. """ + from __future__ import annotations import time diff --git a/src/pytest_bdd/scenario.py b/src/pytest_bdd/scenario.py index a8c176fd..70928813 100644 --- a/src/pytest_bdd/scenario.py +++ b/src/pytest_bdd/scenario.py @@ -10,6 +10,7 @@ scenario_name="Publishing the article", ) """ + from __future__ import annotations import contextlib diff --git a/src/pytest_bdd/scripts.py b/src/pytest_bdd/scripts.py index 9523183a..562575b3 100644 --- a/src/pytest_bdd/scripts.py +++ b/src/pytest_bdd/scripts.py @@ -1,4 +1,5 @@ """pytest-bdd scripts.""" + from __future__ import annotations import argparse diff --git a/src/pytest_bdd/steps.py b/src/pytest_bdd/steps.py index b72766e7..7642a6e8 100644 --- a/src/pytest_bdd/steps.py +++ b/src/pytest_bdd/steps.py @@ -34,6 +34,7 @@ def _(article): pass """ + from __future__ import annotations import enum diff --git a/src/pytest_bdd/types.py b/src/pytest_bdd/types.py index 32692768..8faf940a 100644 --- a/src/pytest_bdd/types.py +++ b/src/pytest_bdd/types.py @@ -1,4 +1,5 @@ """Common type definitions.""" + from __future__ import annotations FEATURE = "feature" diff --git a/src/pytest_bdd/utils.py b/src/pytest_bdd/utils.py index eb243e5d..efe16ff6 100644 --- a/src/pytest_bdd/utils.py +++ b/src/pytest_bdd/utils.py @@ -1,4 +1,5 @@ """Various utility functions.""" + from __future__ import annotations import base64 diff --git a/tests/feature/test_cucumber_json.py b/tests/feature/test_cucumber_json.py index d3c7b931..71a12976 100644 --- a/tests/feature/test_cucumber_json.py +++ b/tests/feature/test_cucumber_json.py @@ -1,4 +1,5 @@ """Test cucumber json output.""" + from __future__ import annotations import json diff --git a/tests/feature/test_feature_base_dir.py b/tests/feature/test_feature_base_dir.py index 5882b22c..669571c7 100644 --- a/tests/feature/test_feature_base_dir.py +++ b/tests/feature/test_feature_base_dir.py @@ -1,4 +1,5 @@ """Test feature base dir.""" + import os import pytest diff --git a/tests/feature/test_multiline.py b/tests/feature/test_multiline.py index 37cd58c2..2d531b5d 100644 --- a/tests/feature/test_multiline.py +++ b/tests/feature/test_multiline.py @@ -1,4 +1,5 @@ """Multiline steps tests.""" + import textwrap import pytest diff --git a/tests/feature/test_outline.py b/tests/feature/test_outline.py index d6b9a451..c8bfe9c4 100644 --- a/tests/feature/test_outline.py +++ b/tests/feature/test_outline.py @@ -1,4 +1,5 @@ """Scenario Outline tests.""" + import textwrap from pytest_bdd.utils import collect_dumped_objects diff --git a/tests/feature/test_outline_empty_values.py b/tests/feature/test_outline_empty_values.py index 8cd24742..329434b6 100644 --- a/tests/feature/test_outline_empty_values.py +++ b/tests/feature/test_outline_empty_values.py @@ -1,4 +1,5 @@ """Scenario Outline with empty example values tests.""" + import textwrap from pytest_bdd.utils import collect_dumped_objects diff --git a/tests/feature/test_report.py b/tests/feature/test_report.py index 727a7486..bdc89855 100644 --- a/tests/feature/test_report.py +++ b/tests/feature/test_report.py @@ -1,4 +1,5 @@ """Test scenario reporting.""" + import textwrap import pytest diff --git a/tests/feature/test_scenarios.py b/tests/feature/test_scenarios.py index 1392de29..ccfcf14a 100644 --- a/tests/feature/test_scenarios.py +++ b/tests/feature/test_scenarios.py @@ -1,4 +1,5 @@ """Test scenarios shortcut.""" + import textwrap diff --git a/tests/feature/test_tags.py b/tests/feature/test_tags.py index 395a6b60..f1dea803 100644 --- a/tests/feature/test_tags.py +++ b/tests/feature/test_tags.py @@ -1,4 +1,5 @@ """Test tags.""" + import textwrap import pytest diff --git a/tests/generation/test_generate_missing.py b/tests/generation/test_generate_missing.py index 82d8db42..d6be9be6 100644 --- a/tests/generation/test_generate_missing.py +++ b/tests/generation/test_generate_missing.py @@ -1,4 +1,5 @@ """Code generation and assertion tests.""" + import itertools import textwrap diff --git a/tests/library/test_parent.py b/tests/library/test_parent.py index b479003c..a18151df 100644 --- a/tests/library/test_parent.py +++ b/tests/library/test_parent.py @@ -2,6 +2,7 @@ Check the parent givens are collected and overridden in the local conftest. """ + import textwrap from pytest_bdd.utils import collect_dumped_objects diff --git a/tests/steps/test_given.py b/tests/steps/test_given.py index bb127e19..ff1e7491 100644 --- a/tests/steps/test_given.py +++ b/tests/steps/test_given.py @@ -1,4 +1,5 @@ """Given tests.""" + import textwrap