Skip to content

Commit 30ffbe2

Browse files
authored
Merge pull request #711 from pytest-dev/drop-pytest62-compat
Drop compatibility with pytest < 7
2 parents 1311af4 + 11de729 commit 30ffbe2

File tree

7 files changed

+8
-8
lines changed

7 files changed

+8
-8
lines changed

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Changelog
33

44
Unreleased
55
----------
6+
- Drop compatibility with pytest < 7.0.0.
67

78
8.0.0b1
89
----------

poetry.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ python = ">=3.8"
3939
Mako = "*"
4040
parse = "*"
4141
parse-type = "*"
42-
pytest = ">=6.2.0"
42+
pytest = ">=7.0.0"
4343
typing-extensions = "*"
4444
packaging = "*"
4545
gherkin-official = "^29.0.0"

src/pytest_bdd/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ def collect_dumped_objects(result: RunResult) -> list:
7171
Note: You must run the result with output to stdout enabled.
7272
For example, using ``pytester.runpytest("-s")``.
7373
"""
74-
stdout = result.stdout.str() # pytest < 6.2, otherwise we could just do str(result.stdout)
74+
stdout = str(result.stdout)
7575
payloads = re.findall(rf"{_DUMP_START}(.*?){_DUMP_END}", stdout)
7676
return [pickle.loads(base64.b64decode(payload)) for payload in payloads]
7777

tests/generation/test_generate_missing.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def _(param):
137137
assert not result.stderr.str()
138138
assert result.ret == 0
139139

140-
output = result.stdout.str()
140+
output = str(result.stdout)
141141

142142
assert "I use the string parser" not in output
143143
assert "I use parsers.parse" not in output

tests/scripts/test_generate.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_generate_with_quotes(pytester):
100100
)
101101

102102
result = pytester.run("pytest-bdd", "generate", "generate_with_quotes.feature")
103-
assert result.stdout.str() == textwrap.dedent(
103+
assert str(result.stdout) == textwrap.dedent(
104104
'''\
105105
"""Handling quotes in code generation feature tests."""
106106
@@ -211,4 +211,4 @@ def _():
211211
raise NotImplementedError
212212
'''
213213
)
214-
assert result.stdout.str() == expected_output
214+
assert str(result.stdout) == expected_output

tox.ini

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tox]
22
distshare = {homedir}/.tox/distshare
3-
envlist = py{3.8,3.9,3.10,3.11}-pytest{6.2,7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2,8.3,latest}-coverage
3+
envlist = py{3.8,3.9,3.10,3.11}-pytest{7.0,7.1,7.2,7.3,7.4,8.0,8.1,8.2,8.3,latest}-coverage
44
py{3.12,3.13}-pytest{7.3,7.4,8.0,8.1,8.2,8.3,latest}-coverage
55
py3.12-pytestlatest-xdist-coverage
66
mypy
@@ -19,7 +19,6 @@ deps =
1919
pytest7.2: pytest~=7.2.0
2020
pytest7.1: pytest~=7.1.0
2121
pytest7.0: pytest~=7.0.0
22-
pytest6.2: pytest~=6.2.0
2322

2423
coverage: coverage[toml]
2524
xdist: pytest-xdist

0 commit comments

Comments
 (0)