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
pytest.ini wins even when it's empty, and .pytest.ini is never read #159
pytest's rule: pytest.ini "will always match and take precedence … even if empty", and it matches even without a [pytest] section. The hidden .pytest.ini works the same way. Only pyproject.toml, tox.ini and setup.cfg need their section to match. The first match wins, and options are never merged.
readPytestSettings skips any file without the section (if (!section) continue;) and never looks at .pytest.ini. So:
With a pytest.ini that has only a comment, plus a pyproject.toml that sets python_files = ["check_*.py"], DiffCI uses check_*.py. pytest uses its defaults, test_*.py and *_test.py. DiffCI then doesn't see test_x.py as a test.
With only a .pytest.ini that sets python_files = check_*.py, DiffCI uses the defaults and doesn't see check_x.py as a test.
Done when:
The search order is pytest.ini, .pytest.ini, then pyproject.toml, tox.ini and setup.cfg.
An existing pytest.ini or .pytest.ini stops the search, even without a [pytest] section. pytest's defaults apply when it has no section.
.pytest.ini is added to PROJECT_FILES, so a repository whose only pytest file is .pytest.ini is detected as a Python project.
There is a test for each of the two cases above.
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): pytest.ini wins even when empty, and read .pytest.ini (D…