Skip to content

Commit e45c3d4

Browse files
soodokuclaude
andauthored
Configure pytest to fail on what it should fail on (#81)
py-canon 1.3.0 puts the whole sp-repo-review PP301-PP309 set in the template: minversion, log_level, xfail_strict, filterwarnings = ["error"], and -ra/--strict-config/--strict-markers in addopts. These decide whether a run *fails* rather than how it reads. Without filterwarnings a dependency's DeprecationWarning stays invisible until the release that removes the API; without --strict-markers a typo in a marker name selects nothing and reports success; without --strict-config a typo in this very table is ignored. Applied with `preen fix pytest-config`, and the suite was run under the new settings before this was opened -- the point of the change is that warnings now fail, so a config that quietly breaks the suite would defeat it. Claude-Session: https://claude.ai/code/session_011SkMDqnEFUgr7Mbc1HwMqX Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
1 parent 1d58296 commit e45c3d4

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

pyproject.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,11 +101,7 @@ testpaths = ["tests"]
101101
python_files = ["test_*.py"]
102102
python_classes = ["Test*"]
103103
python_functions = ["test_*"]
104-
addopts = [
105-
"-v",
106-
"--strict-markers",
107-
"--strict-config",
108-
]
104+
addopts = ["-v", "--strict-markers", "--strict-config", "-ra"]
109105
filterwarnings = [
110106
# A test that returns instead of asserting silently passes no matter what
111107
# it computed. Make that a hard failure rather than a warning.
@@ -117,6 +113,9 @@ markers = [
117113
"asyncio: marks tests as async",
118114
"local: marks tests that require local IDE setup (not run in CI)",
119115
]
116+
minversion = "6"
117+
log_level = "INFO"
118+
xfail_strict = true
120119

121120
[tool.ruff]
122121
line-length = 88

0 commit comments

Comments
 (0)