Skip to content

docs: add test readability guidance - #684

Merged
InessaPawson merged 4 commits into
pyOpenSci:mainfrom
kernelpanic888:task24-c08-test-readability-20260706
Sep 5, 2026
Merged

docs: add test readability guidance#684
InessaPawson merged 4 commits into
pyOpenSci:mainfrom
kernelpanic888:task24-c08-test-readability-20260706

Conversation

@kernelpanic888

@kernelpanic888 kernelpanic888 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a short section on best practices for writing tests

Checks

  • git diff --check
  • .venv/bin/sphinx-build -W --keep-going -b html . _build/html -D language=en

Closes #509

@InessaPawson InessaPawson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your PR, @kernelpanic888! This aligns well with what @lwasser and @eliotwrobson discussed in #509. The section reads well and matches the voice of the rest of the page.

I have 2 suggestions for your submission:

  1. Point the references to resources that are more specific to the subject of this PR. Currently, they link to the pytest landing page and the unittest module documentation, neither of which specifically addresses writing readable tests. (And the pytest homepage is already linked twice in this guide.)
  2. Add a short good example right under the bullets.
    @lwasser suggested drawing on our packaging template output , which is what we teach in PyOS workshops. tests/run-tests.md already references pyos-package-template, so there is a precedent for pulling from it. An example would also ground the bullets in something package-specific, which addresses @eliotwrobson's concern about this part of the guide being generic.

@InessaPawson

Copy link
Copy Markdown
Contributor

@lwasser @eliotwrobson I feel like this section would fit better below ### How do you know what type of tests to write? First, we discuss what tests to write, then move to how to write them well. Curious to hear your thoughts! 🙂

@InessaPawson

Copy link
Copy Markdown
Contributor

@allcontributors please add @kernelpanic888 for doc

@allcontributors

Copy link
Copy Markdown
Contributor

@InessaPawson

I've put up a pull request to add @kernelpanic888! 🎉

@InessaPawson
InessaPawson merged commit 5122919 into pyOpenSci:main Sep 5, 2026
5 checks passed
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.

Enhance the Tests section with best practices for clarity and documentation

4 participants