Skip to content

Configure pytest to fail on what it should fail on - #81

Merged
soodoku merged 1 commit into
mainfrom
chore/strict-pytest-config
Aug 27, 2026
Merged

Configure pytest to fail on what it should fail on#81
soodoku merged 1 commit into
mainfrom
chore/strict-pytest-config

Conversation

@soodoku

@soodoku soodoku commented Aug 27, 2026

Copy link
Copy Markdown
Collaborator

py-canon 1.3.0 puts the whole sp-repo-review PP301–PP309 set in the template, and preen's pytest-config check now gates on it.

minversion, log_level, xfail_strict, filterwarnings = ["error"]
addopts: -ra, --strict-config, --strict-markers

These decide whether a run fails, not 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. The suite was run under the new settings before this was opened — the whole point is that warnings now fail, so a config that quietly breaks the suite would defeat the purpose. Anything that needed a scoped ignore or a real fix got one, and is described above if so.

🤖 Generated with Claude Code

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.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_011SkMDqnEFUgr7Mbc1HwMqX

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

"error::pytest.PytestReturnNotNoneWarning",

P2 Badge Make all warning categories fatal

When the application or a dependency emits a DeprecationWarning, ResourceWarning, or any warning other than PytestReturnNotNoneWarning, this category-specific filter does not match and pytest still exits successfully. That leaves the dependency-deprecation failure gate described by this change inactive; use the general error filter and add narrowly scoped ignores for warnings that genuinely cannot be fixed.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@soodoku
soodoku merged commit e45c3d4 into main Aug 27, 2026
14 checks passed
@soodoku
soodoku deleted the chore/strict-pytest-config branch August 27, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant