Skip to content

Add edge-case tests, exclude pytest tmpdirs from ruff/git - #25

Merged
hutchins merged 1 commit into
mainfrom
chore/test-coverage-and-cleanup
May 16, 2026
Merged

Add edge-case tests, exclude pytest tmpdirs from ruff/git#25
hutchins merged 1 commit into
mainfrom
chore/test-coverage-and-cleanup

Conversation

@hutchins

Copy link
Copy Markdown
Owner

Summary

  • New test for leafpress ui ImportError fallback when PyQt6 is not installed (asserts exit code 1, panel content, and leafpress[ui] install hint).
  • New test for the pipeline OSError branch when WeasyPrint is importable but its system libraries (cairo/pango/etc.) can't be loaded — verifies the error message names cairo, suggests leafpress doctor, and preserves the original error.
  • Adds pytest-of-*/, leafpress-mermaid-*/, and uv-*.lock to .gitignore and to ruff's extend-exclude. Stale pytest tmpdirs were causing ruff check to fail on an intentionally-malformed TOML fixture file.
  • 781 total tests (was 779). Coverage 91.44%.

Test plan

  • uv run ruff check
  • uv run ruff format --check
  • uv run ty check
  • uv run pytest — 781 passed

Adds two tests for previously-uncovered error paths:
- `leafpress ui` ImportError fallback when PyQt6 isn't installed
- pipeline OSError branch when WeasyPrint is installed but its system
  libraries can't be loaded (cairo/pango missing)

Also fixes a side issue: leftover pytest tmpdirs (`pytest-of-*/`,
`leafpress-mermaid-*/`, `uv-*.lock`) were being picked up by `ruff
check`, causing the lint step to fail on a fixture file containing
intentionally-malformed TOML. Adds them to ruff's extend-exclude and
to .gitignore so they no longer pollute the working tree or break
linting.
@hutchins
hutchins merged commit 92f08ef into main May 16, 2026
1 check passed
@hutchins
hutchins deleted the chore/test-coverage-and-cleanup branch May 16, 2026 03:33
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