Skip to content

build: 🔨 move pytest options into pytest.ini so VS Code detects them #59

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 23, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ group:
dest: justfile
- source: .cz.toml
dest: .cz.toml
- source: pytest.ini
dest: pytest.ini
- source: ruff.toml
dest: ruff.toml
- source: LICENSE.md
Expand Down
16 changes: 1 addition & 15 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,7 @@ install-deps:

# Run the Python tests
test-python:
# - A short traceback (tb) mode to make it easier to view
# - Use the `src/` package (importlib)
# - Use code coverage on the `src/` package
# - If tests fail, do not generate coverage report
# - Create the coverage report in XML (for badge), terminal, and HTML
# - Trigger failure if below 90% code coverage
uv run pytest \
--tb=short \
--import-mode=importlib \
--cov=src \
--no-cov-on-fail \
--cov-report=term \
--cov-report=xml \
--cov-report=html \
--cov-fail-under=90
uv run pytest
# Make the badge from the coverage report
uv run genbadge coverage \
-i coverage.xml \
Expand Down
8 changes: 8 additions & 0 deletions pytest.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[pytest]
# - A short traceback (tb) mode to make it easier to view
# - Use the `src/` package (importlib)
# - Use code coverage on the `src/` package
# - If tests fail, do not generate coverage report
# - Create the coverage report in XML (for badge), terminal, and HTML
# - Trigger failure if below 90% code coverage
addopts = --tb=short --import-mode=importlib --cov=src --no-cov-on-fail --cov-report=term --cov-report=xml --cov-report=html --cov-fail-under=90