Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/_includes/pyproject.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@ with code_fence("toml"):
```toml
[dependency-groups]
test = [
"pytest >=6",
"pytest-cov >=3",
"pytest >=9",
"pytest-cov >=7",
]
dev = [
{ include-group = "test" },
Expand Down
20 changes: 10 additions & 10 deletions docs/pages/guides/pytest.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ pytest supports configuration in `pytest.ini`, `setup.cfg`, or, since version 6,
always require 6+ (or 9+) and use `pyproject.toml` or the pytest TOML ones. This
is an example configuration:

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

```toml
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
[tool.pytest]
minversion = "9.0"
addopts = ["-ra", "--showlocals"]
strict = true
filterwarnings = ["error"]
log_level = "INFO"
testpaths = [
"tests",
]
```

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

```toml
[tool.pytest]
minversion = "9.0"
addopts = ["-ra", "--showlocals"]
strict = true
[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
filterwarnings = ["error"]
log_level = "INFO"
testpaths = [
Expand Down
2 changes: 1 addition & 1 deletion docs/pages/principles/testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ conceptually part of a larger suite, and skip them when needed.
First, define a new marker in `pyproject.toml`:

```toml
[tool.pytest.ini_options]
[tool.pytest]
markers = [
"unit: marks unit tests",
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
Expand Down
10 changes: 5 additions & 5 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ dev = [
"validate-pyproject-schema-store[all]",
]
test = [
"pytest >=7",
"pytest >=9",
"repo-review >=0.10.6",
]
cog = [
Expand All @@ -110,10 +110,10 @@ content-type = "text/markdown"
path = "README.md"
start-after = "<!-- sp-repo-review -->"

[tool.pytest.ini_options]
minversion = "7.0"
addopts = ["-ra", "--strict-markers", "--strict-config"]
xfail_strict = true
[tool.pytest]
minversion = "9.0"
addopts = ["-ra"]
strict = true
log_level = "INFO"
filterwarnings = [
'error',
Expand Down
16 changes: 8 additions & 8 deletions {{cookiecutter.project_name}}/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ Changelog = "{{ cookiecutter.url }}/releases"

[dependency-groups]
test = [
"pytest >=6",
"pytest-cov >=3",
"pytest >=9",
"pytest-cov >=7",
]
dev = [
{ include-group = "test" },
Expand Down Expand Up @@ -218,8 +218,8 @@ substitution.files = ["src/{{ cookiecutter.__project_slug }}/__init__.py"]
{%- endif %}

[tool.poetry.group.test.dependencies]
pytest = ">= 6"
pytest-cov = ">= 3"
pytest = ">= 9"
pytest-cov = ">= 7"
{%- endif %}


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


[tool.pytest.ini_options]
minversion = "6.0"
addopts = ["-ra", "--showlocals", "--strict-markers", "--strict-config"]
xfail_strict = true
[tool.pytest]
minversion = "9.0"
addopts = ["-ra", "--showlocals"]
strict = true
filterwarnings = [
"error",
]
Expand Down
Loading