Skip to content

docs: document the contributor testing workflow #438

Description

@rudyy07

Problem

As a first-time contributor, I found it difficult to determine the
expected workflow for adding and verifying tests.

While working on #429, I had to figure out:

  • how to find the appropriate test file
  • how to follow the repository's existing pytest conventions
  • how to run focused tests
  • how to run the full test suite
  • how to verify that a regression test actually fails when the
    protected behavior is broken

The current contributor documentation does not explain this workflow
for someone making their first test contribution.

Proposed change

Add a short contributor-testing section explaining how to:

  1. Find the relevant existing test file.
  2. Follow the repository's existing test patterns.
  3. Add parameterized test cases where appropriate.
  4. Run the relevant tests locally.
  5. Intentionally verify that the test catches a regression.
  6. Run the full test suite before opening a PR.

The section would use a small example based on the existing test suite.

Motivation

I encountered this while working on #429, where I added parameterized
tests for two-sided humanize.clamp() boundary behavior.

I also intentionally introduced a regression to verify that the new
test failed, then restored the implementation and ran the full suite.

Related PR: #429

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions