Skip to content

fix: remove stale self-contained-html pytest config option - #136

Closed
abhihashi wants to merge 2 commits into
mainfrom
fix/pytest-unknown-config-self-contained-html
Closed

fix: remove stale self-contained-html pytest config option#136
abhihashi wants to merge 2 commits into
mainfrom
fix/pytest-unknown-config-self-contained-html

Conversation

@abhihashi

Copy link
Copy Markdown
Contributor

Summary

pytest 9.x changed unknown [tool.pytest.ini_options] entries from a warning to a hard error (exit code 4), which causes test collection to abort entirely — no tests run.

self-contained-html is a pytest-html plugin option, but pytest-html is not a declared dependency of this project. The option has been a no-op since the project was set up and is now actively breaking CI.

Change

-self-contained-html = true

Verification

Local collection after the fix:

281 tests collected in 5.95s

ruff 0.16.x expanded its default rule set to include UP (pyupgrade), PIE,
and RUF rules not previously enforced, causing CI to fail on every PR.
This commit resolves all violations so the lint step passes cleanly.

Changes in pyproject.toml:
- Add [tool.ruff.lint] with an explicit select and ignore list, pinning the
  enforced rule set so future ruff upgrades cannot silently add new failures
- Ignore E501 (line-too-long) and RUF012 (mutable-class-default) which are
  either the formatter's responsibility or a pydantic Field() pattern

Codebase changes (ruff --fix + manual):
- UP006/UP007/UP045: replace deprecated typing generics (List, Dict,
  Optional, Tuple) with built-in equivalents (list, dict, X | None, tuple)
- UP035: remove unused 'from typing import ...' lines
- UP015/UP018: remove redundant open() mode args and str() literals
- PIE790: remove unnecessary pass in abstract method stubs
- RUF100: remove unused noqa directives
- E712: replace '== True' comparisons with truthiness checks
- W291/W293/W292: remove trailing whitespace and add missing EOF newlines
@abhihashi
abhihashi requested a review from a team as a code owner August 19, 2026 12:48
pytest 9.x treats unknown ini_options as a hard error (exit code 4),
causing no tests to be collected. self-contained-html is a pytest-html
plugin option but pytest-html is not a declared dependency. Remove the
stale option to restore test collection.
@abhihashi
abhihashi force-pushed the fix/pytest-unknown-config-self-contained-html branch from 5a98667 to fc9be5f Compare August 19, 2026 13:13
@abhihashi

Copy link
Copy Markdown
Contributor Author

The self-contained-html removal has been folded into PR #135 (fix/ci-lint-violations-v2) so that #135 achieves a fully green CI run on its own. Closing this PR as redundant.

@abhihashi abhihashi closed this Aug 19, 2026
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