Skip to content

fix(test): make pytest config parse on current pytest#66

Open
guyua9 wants to merge 1 commit into
botingw:mainfrom
guyua9:fix/pytest-addopts-list-guyua9
Open

fix(test): make pytest config parse on current pytest#66
guyua9 wants to merge 1 commit into
botingw:mainfrom
guyua9:fix/pytest-addopts-list-guyua9

Conversation

@guyua9

@guyua9 guyua9 commented May 9, 2026

Copy link
Copy Markdown

Summary

  • move pytest settings to the supported tool.pytest.ini_options table
  • make addopts a TOML list so current pytest can parse it
  • add pythonpath = ["src"] and a collect-only regression test from the repo root

Why

With current pytest, the repository fails before test collection because addopts is stored as a string in pyproject.toml:

TypeError: ... config option 'addopts' expects a list for type 'args', got str: '-v'

That blocks even targeted unit tests. This keeps the same -v behavior while using the TOML shape current pytest expects.

Tests

  • uv run pytest tests/unit/test_pytest_config.py tests/unit/test_state_files.py -q
  • uv run --extra dev ruff check tests/unit/test_pytest_config.py
  • uv run --extra dev ruff format --check tests/unit/test_pytest_config.py
  • git diff --check

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