Skip to content
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

Unit test improvements #9

Merged
merged 9 commits into from
Jul 23, 2024
Merged

Unit test improvements #9

merged 9 commits into from
Jul 23, 2024

Conversation

JWCook
Copy link

@JWCook JWCook commented Jul 22, 2024

Closes #6.

  • Test both RSS and Atom output formats
  • Parse XML output and compare one element at a time. This gives better test output on failure, and ignores parts that don't matter.
  • Report test status in CI. Failing tests will prevent merging a PR or publishing a package.
  • Add coverage report config with pytest-cov. By default, it will show condensed terminal output (total coverage). Adding --cov-report=html will generate a detailed HTML report (line coverage).
  • Add some missing test coverage; now at 95%
  • Run Sphinx builds in tests using SphinxTestApp.
    • This is a pytest plugin that comes with Sphinx, and is poorly documented but quite useful for testing. It does some extra environment setup that allows invoking Sphinx from python instead of subprocess(['sphinx-build', ...]).
    • You can see the full build output with pytest -vs.

Let me know if you have any suggestions, or questions about how it works!

@JWCook JWCook marked this pull request as draft July 22, 2024 15:17
@JWCook JWCook force-pushed the tests branch 2 times, most recently from 20e84f9 to 7042863 Compare July 22, 2024 15:53
@JWCook JWCook marked this pull request as ready for review July 22, 2024 15:57
@lsaffre lsaffre merged commit f3fcf6a into lsaffre:master Jul 23, 2024
6 checks passed
@JWCook JWCook deleted the tests branch July 23, 2024 03:19
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.

Unit test improvements
2 participants