Skip to content

Commit e20e492

Browse files
Merge branch 'master' into scenarios-codegen-take2
2 parents 6a805b8 + 582f045 commit e20e492

16 files changed

Lines changed: 134 additions & 463 deletions

.github/workflows/main.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@ jobs:
4545
fail-fast: false
4646
matrix:
4747
include:
48-
- python-version: "3.9"
49-
toxfactor: py3.9
50-
ignore-typecheck-outcome: false
51-
ignore-test-outcome: false
5248
- python-version: "3.10"
5349
toxfactor: py3.10
5450
ignore-typecheck-outcome: false

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,6 @@ cover/
5454

5555
#PyCharm
5656
/.idea
57+
58+
# Generated by the tox mypy env (poetry export)
59+
/requirements.txt

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ Deprecated
2323

2424
Removed
2525
+++++++
26+
* Dropped support for python 3.9 (end-of-life, and its locked dev dependencies had unfixable security alerts). Supported python versions: 3.10, 3.11, 3.12, 3.13, 3.14.
2627
* The following private attributes are not available anymore (`#658 <https://github.com/pytest-dev/pytest-bdd/pull/658>`_):
2728
* ``_pytest.reports.TestReport.scenario``; replaced by ``pytest_bdd.reporting.test_report_context`` WeakKeyDictionary (internal use)
2829
* ``__scenario__`` attribute of test functions generated by the ``@scenario`` (and ``@scenarios``) decorator; replaced by ``pytest_bdd.scenario.scenario_wrapper_template_registry`` WeakKeyDictionary (internal use)

poetry.lock

Lines changed: 16 additions & 438 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,13 @@ classifiers = [
2222
"Topic :: Software Development :: Libraries",
2323
"Topic :: Utilities",
2424
"Programming Language :: Python :: 3",
25-
"Programming Language :: Python :: 3.9",
2625
"Programming Language :: Python :: 3.10",
2726
"Programming Language :: Python :: 3.11",
2827
"Programming Language :: Python :: 3.12",
2928
"Programming Language :: Python :: 3.13",
3029
"Programming Language :: Python :: 3.14",
3130
]
32-
requires-python = ">=3.9"
31+
requires-python = ">=3.10"
3332
dependencies = [
3433
"Mako",
3534
"parse",
@@ -74,7 +73,6 @@ build-backend = "poetry.core.masonry.api"
7473

7574
[tool.ruff]
7675
line-length = 120
77-
target-version = "py39"
7876
lint.select = [
7977
"B", # flake8-bugbear
8078
"BLE", # flake8-blind-except

src/pytest_bdd/parser.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ def as_contexts(self) -> Generator[dict[str, str]]:
121121
dict[str, str]: A dictionary mapping parameter names to their values for each example row.
122122
"""
123123
for row in self.examples:
124-
assert len(self.example_params) == len(row)
125-
yield dict(zip(self.example_params, row))
124+
yield dict(zip(self.example_params, row, strict=True))
126125

127126
def __bool__(self) -> bool:
128127
"""Check if there are any examples.

src/pytest_bdd/plugin.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,10 @@
22

33
from __future__ import annotations
44

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

88
import pytest
9-
from typing_extensions import ParamSpec
109

1110
from . import cucumber_json, generation, gherkin_terminal_reporter, given, reporting, then, when
1211
from .utils import CONFIG_STACK

src/pytest_bdd/reporting.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
from __future__ import annotations
88

99
import time
10+
from collections.abc import Callable
1011
from dataclasses import dataclass
11-
from typing import TYPE_CHECKING, Callable, TypedDict
12+
from typing import TYPE_CHECKING, TypedDict
1213
from weakref import WeakKeyDictionary
1314

1415
from typing_extensions import NotRequired

src/pytest_bdd/scenario.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
import logging
1818
import os
1919
import re
20-
from collections.abc import Iterable, Iterator
20+
from collections.abc import Callable, Iterable, Iterator
2121
from inspect import signature
22-
from typing import TYPE_CHECKING, Callable, TypeVar, cast
22+
from typing import TYPE_CHECKING, TypeVar, cast
2323
from weakref import WeakKeyDictionary
2424

2525
import pytest
2626
from _pytest.fixtures import FixtureDef, FixtureManager, FixtureRequest, call_fixture_func
27+
from _pytest.outcomes import Failed
2728

2829
from . import exceptions
2930
from .compat import getfixturedefs, inject_fixture
@@ -247,7 +248,7 @@ def _execute_step_function(
247248
# so that we can allow "yield" statements in it
248249
return_value = call_fixture_func(fixturefunc=context.step_func, request=request, kwargs=kwargs)
249250

250-
except Exception as exception:
251+
except (Exception, Failed) as exception:
251252
request.config.hook.pytest_bdd_step_error(exception=exception, **kw)
252253
raise
253254

src/pytest_bdd/steps.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,13 @@ def _(article):
3838
from __future__ import annotations
3939

4040
import enum
41-
from collections.abc import Iterable
41+
from collections.abc import Callable, Iterable
4242
from dataclasses import dataclass, field
4343
from itertools import count
44-
from typing import Callable, Literal, TypeVar
44+
from typing import Literal, ParamSpec, TypeVar
4545
from weakref import WeakKeyDictionary
4646

4747
import pytest
48-
from typing_extensions import ParamSpec
4948

5049
from .parser import Step
5150
from .parsers import StepParser, get_parser

0 commit comments

Comments
 (0)