Skip to content

Commit 3c3fa77

Browse files
authored
Merge branch 'master' into docstrings
2 parents 94772f9 + 336f6e1 commit 3c3fa77

File tree

15 files changed

+43
-35
lines changed

15 files changed

+43
-35
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@ jobs:
1111
strategy:
1212
matrix:
1313
include:
14-
- python-version: "3.8"
15-
toxfactor: py3.8
16-
ignore-typecheck-outcome: false
17-
ignore-test-outcome: false
1814
- python-version: "3.9"
1915
toxfactor: py3.9
2016
ignore-typecheck-outcome: false
@@ -31,7 +27,7 @@ jobs:
3127
toxfactor: py3.12
3228
ignore-typecheck-outcome: false
3329
ignore-test-outcome: false
34-
- python-version: "3.13-dev"
30+
- python-version: "3.13"
3531
toxfactor: py3.13
3632
ignore-typecheck-outcome: false
3733
ignore-test-outcome: false

.pre-commit-config.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@ repos:
2222
rev: v3.18.0
2323
hooks:
2424
- id: pyupgrade
25-
args: ["--py38-plus"]
26-
# TODO: Enable mypy checker when the checks succeed
27-
#- repo: https://github.com/pre-commit/mirrors-mypy
28-
# rev: v0.931
29-
# hooks:
30-
# - id: mypy
31-
# additional_dependencies: [types-setuptools]
25+
args: ["--py39-plus"]
26+
- repo: https://github.com/pycqa/flake8
27+
rev: "7.1.1"
28+
hooks:
29+
- id: flake8
30+
additional_dependencies: [
31+
"flake8-pyproject",
32+
"flake8-bugbear",
33+
]

CHANGES.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ Changelog
33

44
Unreleased
55
----------
6+
- Dropped support for python 3.8. Supported python versions: 3.9, 3.10, 3.11, 3.12, 3.13.
7+
8+
8.0.0b2
9+
----------
610
- Update documentation to clarify that `--gherkin-terminal-reporter` needs to be used with `-v` or `-vv`.
711
- Drop compatibility with pytest < 7.0.0.
812
- Continuation of steps using asterisks instead of And/But supported.

docs/conf.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020

2121
sys.path.insert(0, os.path.abspath(".."))
2222

23-
import pytest_bdd
24-
2523
# -- General configuration -----------------------------------------------------
2624

2725
# If your documentation needs a minimal Sphinx version, state it here.
@@ -175,11 +173,11 @@
175173

176174
latex_elements = {
177175
# The paper size ('letterpaper' or 'a4paper').
178-
#'papersize': 'letterpaper',
176+
# 'papersize': 'letterpaper',
179177
# The font size ('10pt', '11pt' or '12pt').
180-
#'pointsize': '10pt',
178+
# 'pointsize': '10pt',
181179
# Additional stuff for the LaTeX preamble.
182-
#'preamble': '',
180+
# 'preamble': '',
183181
}
184182

185183
# Grouping the document tree into LaTeX files. List of tuples

pyproject.toml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pytest-bdd"
3-
version = "8.0.0b1"
3+
version = "8.0.0b2"
44
description = "BDD for pytest"
55
authors = ["Oleg Pidsadnyi <[email protected]>", "Anatoly Bubenkov <[email protected]>"]
66
maintainers = ["Alessio Bogon <[email protected]>"]
@@ -20,7 +20,6 @@ classifiers = [
2020
"Topic :: Software Development :: Libraries",
2121
"Topic :: Utilities",
2222
"Programming Language :: Python :: 3",
23-
"Programming Language :: Python :: 3.8",
2423
"Programming Language :: Python :: 3.9",
2524
"Programming Language :: Python :: 3.10",
2625
"Programming Language :: Python :: 3.11",
@@ -58,7 +57,14 @@ build-backend = "poetry.core.masonry.api"
5857

5958
[tool.black]
6059
line-length = 120
61-
target-version = ["py38", "py39", "py310", "py311", "py312"]
60+
target-version = ["py39", "py310", "py311", "py312", "py313"]
61+
62+
[tool.flake8]
63+
# E1: indentation: already covered by `black`
64+
# E2: whitespace: already covered by `black`
65+
# E3: blank line: already covered by `black`
66+
# E501: line length: already covered by `black`
67+
extend-ignore = "E1,E2,E3,E501"
6268

6369
[tool.isort]
6470
profile = "black"
@@ -90,7 +96,7 @@ source = [
9096

9197

9298
[tool.mypy]
93-
python_version = "3.8"
99+
python_version = "3.9"
94100
warn_return_any = true
95101
warn_unused_configs = true
96102
files = "src/pytest_bdd/**/*.py"

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: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
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

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: 4 additions & 3 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
@@ -50,7 +51,7 @@ def find_fixturedefs_for_step(step: Step, fixturemanager: FixtureManager, node:
5051
# happens to be that _arg2fixturedefs is changed during the iteration so we use a copy
5152
fixture_def_by_name = list(fixturemanager._arg2fixturedefs.items())
5253
for fixturename, fixturedefs in fixture_def_by_name:
53-
for pos, fixturedef in enumerate(fixturedefs):
54+
for _, fixturedef in enumerate(fixturedefs):
5455
step_func_context = getattr(fixturedef.func, "_pytest_bdd_step_context", None)
5556
if step_func_context is None:
5657
continue
@@ -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

0 commit comments

Comments
 (0)