Skip to content

Commit 602915c

Browse files
authored
chore: use pytest 9+, default to that (#725)
Signed-off-by: Henry Schreiner <[email protected]>
1 parent c999861 commit 602915c

File tree

5 files changed

+26
-26
lines changed

5 files changed

+26
-26
lines changed

docs/_includes/pyproject.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ with code_fence("toml"):
149149
```toml
150150
[dependency-groups]
151151
test = [
152-
"pytest >=6",
153-
"pytest-cov >=3",
152+
"pytest >=9",
153+
"pytest-cov >=7",
154154
]
155155
dev = [
156156
{ include-group = "test" },

docs/pages/guides/pytest.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -71,27 +71,27 @@ pytest supports configuration in `pytest.ini`, `setup.cfg`, or, since version 6,
7171
always require 6+ (or 9+) and use `pyproject.toml` or the pytest TOML ones. This
7272
is an example configuration:
7373

74-
{% tabs %} {% tab conf-classic Pytest 6+ %}
74+
{% tabs %} {% tab conf-modern Pytest 9+ %}
7575

7676
```toml
77-
[tool.pytest.ini_options]
78-
minversion = "6.0"
79-
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
80-
xfail_strict = true
77+
[tool.pytest]
78+
minversion = "9.0"
79+
addopts = ["-ra", "--showlocals"]
80+
strict = true
8181
filterwarnings = ["error"]
8282
log_level = "INFO"
8383
testpaths = [
8484
"tests",
8585
]
8686
```
8787

88-
{% endtab %} {% tab conf-modern Pytest 9+ %}
88+
{% endtab %} {% tab conf-classic Pytest 6+ %}
8989

9090
```toml
91-
[tool.pytest]
92-
minversion = "9.0"
93-
addopts = ["-ra", "--showlocals"]
94-
strict = true
91+
[tool.pytest.ini_options]
92+
minversion = "6.0"
93+
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
94+
xfail_strict = true
9595
filterwarnings = ["error"]
9696
log_level = "INFO"
9797
testpaths = [

docs/pages/principles/testing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ conceptually part of a larger suite, and skip them when needed.
153153
First, define a new marker in `pyproject.toml`:
154154

155155
```toml
156-
[tool.pytest.ini_options]
156+
[tool.pytest]
157157
markers = [
158158
"unit: marks unit tests",
159159
"slow: marks tests as slow (deselect with '-m \"not slow\"')",

pyproject.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ dev = [
9090
"validate-pyproject-schema-store[all]",
9191
]
9292
test = [
93-
"pytest >=7",
93+
"pytest >=9",
9494
"repo-review >=0.10.6",
9595
]
9696
cog = [
@@ -110,10 +110,10 @@ content-type = "text/markdown"
110110
path = "README.md"
111111
start-after = "<!-- sp-repo-review -->"
112112

113-
[tool.pytest.ini_options]
114-
minversion = "7.0"
115-
addopts = ["-ra", "--strict-markers", "--strict-config"]
116-
xfail_strict = true
113+
[tool.pytest]
114+
minversion = "9.0"
115+
addopts = ["-ra"]
116+
strict = true
117117
log_level = "INFO"
118118
filterwarnings = [
119119
'error',

{{cookiecutter.project_name}}/pyproject.toml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,8 @@ Changelog = "{{ cookiecutter.url }}/releases"
119119

120120
[dependency-groups]
121121
test = [
122-
"pytest >=6",
123-
"pytest-cov >=3",
122+
"pytest >=9",
123+
"pytest-cov >=7",
124124
]
125125
dev = [
126126
{ include-group = "test" },
@@ -218,8 +218,8 @@ substitution.files = ["src/{{ cookiecutter.__project_slug }}/__init__.py"]
218218
{%- endif %}
219219

220220
[tool.poetry.group.test.dependencies]
221-
pytest = ">= 6"
222-
pytest-cov = ">= 3"
221+
pytest = ">= 9"
222+
pytest-cov = ">= 7"
223223
{%- endif %}
224224

225225

@@ -241,10 +241,10 @@ test-extras = ["test"]
241241
{%- endif %}
242242

243243

244-
[tool.pytest.ini_options]
245-
minversion = "6.0"
246-
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
247-
xfail_strict = true
244+
[tool.pytest]
245+
minversion = "9.0"
246+
addopts = ["-ra", "--showlocals"]
247+
strict = true
248248
filterwarnings = [
249249
"error",
250250
]

0 commit comments

Comments
 (0)