You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
pyproject.toml: a comment or ] inside a pytest list drops entries #158
readPytestSettings in src/repo/adapters/python.ts reads python_files, testpaths and pythonpath from [tool.pytest.ini_options] with a regex. The regex takes everything up to the first ], and splitList splits it on whitespace and commas. TOML comments and brackets inside strings both break this:
[tool.pytest.ini_options]
python_files = [
"test_*.py", # see [docs]"check_*.py",
]
Today this returns ["test_*.py", "#", "see", "[docs"], which drops check_*.py. With the comment # unit instead, it returns ["test_*.py", "#", "unit", "check_*.py"]. testpaths = ["tests/[a]", "integration"] returns ["tests/[a"], which drops integration.
Done when:
Comments outside strings are ignored, and a ] or , inside a quoted string stays part of the value. Splitting the list into quoted strings works better than splitting on whitespace.
Anything the reader can't parse with certainty sets settings.unreadable, as a non-literal value already does (see the some_function() case in the test). DiffCI then runs the full suite, which is safe. Never guess.
tests/repo/python-adapter.test.ts has cases for the three examples above, plus a multi-line list with a trailing comma.
New to DiffCI? See CONTRIBUTING.md: add a synthetic fixture, run npm test, and sign off commits with git commit -s. Comment here to claim the issue.
Activity
fix(python): read pyproject pytest lists as TOML strings (DiffCI#315)