Skip to content
Merged
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
38 changes: 38 additions & 0 deletions src/sp_repo_review/checks/pyproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,12 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
support native configuration and toml config files).

```toml
# Old pytest
[tool.pytest.ini_options]
minversion = "6"

# pytest 9
[tool.pytest]
minversion = "9"
```
"""
Expand All @@ -238,8 +243,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
The `testpaths` setting should be set to a reasonable default.

```toml
# Old pytest
[tool.pytest.ini_options]
testpaths = ["tests"]

# pytest 9+
[tool.pytest]
testpaths = ["tests"]
```
"""
_, options = pytest
Expand All @@ -259,8 +269,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
failures.

```toml
# Old pytest
[tool.pytest.ini_options]
log_level = "INFO"

# pytest 9+
[tool.pytest]
log_level = "INFO"
```
"""
_, options = pytest
Expand All @@ -283,6 +298,9 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
```toml
[tool.pytest.ini_options]
xfail_strict = true

[tool.pytest]
strict = true
```
"""
_, options = pytest
Expand All @@ -307,8 +325,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
config setting is misspelled.

```toml
# Old pytest
[tool.pytest.ini_options]
addopts = ["-ra", "--strict-config", "--strict-markers"]

# pytest 9+
[tool.pytest]
strict = true
```
Comment on lines +331 to 335
Copy link

Copilot AI Mar 2, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR description says the “simplest option” is to always show both legacy and pytest 9+ configuration options. PP305’s message still only shows a [tool.pytest.ini_options] example (no [tool.pytest] / pytest.toml example), so users hitting that check won’t see the new format. Consider updating PP305’s docstring example(s) as well to fully match the PR intent.

Copilot uses AI. Check for mistakes.
"""
_, options = pytest
Expand All @@ -333,8 +356,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
be specified in config, avoiding misspellings.

```toml
# Old pytest
[tool.pytest.ini_options]
addopts = ["-ra", "--strict-config", "--strict-markers"]

# pytest 9+
[tool.pytest]
strict = true
```
"""
_, options = pytest
Expand All @@ -358,8 +386,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
(print summary of all fails/errors).

```toml
# Old pytest
[tool.pytest.ini_options]
addopts = ["-ra", "--strict-config", "--strict-markers"]

# pytest 9+
[tool.pytest]
addopts = ["-ra"]
```
"""
loc, options = pytest
Expand All @@ -382,8 +415,13 @@ def check(pytest: tuple[PytestFile, dict[str, Any]]) -> bool:
will hide important warnings otherwise, like deprecations.

```toml
# Old pytest
[tool.pytest.ini_options]
filterwarnings = ["error"]

# pytest 9+
[tool.pytest]
filterwarnings = ["error"]
```
"""
_, options = pytest
Expand Down