Skip to content

Document resetall, the changelog format and running tests with tox - #635

Merged
nicoddemus merged 1 commit into
pytest-dev:mainfrom
nicoddemus:docs-contributing-resetall
Oct 17, 2026
Merged

nicoddemus merged 1 commit into
pytest-dev:mainfrom
nicoddemus:docs-contributing-resetall

Conversation

@nicoddemus

Copy link
Copy Markdown
Member

Documentation gaps that came up repeatedly while reviewing the recent PRs:

  • docs/usage.rst: mocker.resetall() was a one-line bullet. It now has a "Resetting mocks" section describing which mocks it resets (not stubs or mocker.Mock()), the return_value/side_effect arguments, and how patch.multiple (Fix resetall for mocks created by patch.multiple #629), patch.dict and spies (Reset spy_return and spy_exception in resetall() #630, Keep spies calling through after resetall(side_effect=True) #633) are handled.
  • docs/contributing.rst:
    • Run the tests with tox: with the editable install, running pytest directly doesn't rewrite the assertions inside pytest_mock, so the introspection tests fail regardless of the change.
    • The baseline environments are now py314,norewrite.
    • The changelog entry format: a PR link first, PR number order, no blank lines between entries. Most recent PRs needed a follow-up for this.
  • .pre-commit-config.yaml: the rst hook still referred to HOWTORELEASE.rst and a changelog/ directory, so RELEASING.rst and the docs were never linted. It now covers them, except docs/index.rst, which uses Sphinx-only directives.

The new usage example passes as a test, and the docs build with sphinx -W.

🤖 Generated with Claude Code

* usage: add a "Resetting mocks" section describing what resetall()
  resets, its return_value/side_effect arguments, and how patch.multiple,
  patch.dict and spies are handled.
* contributing: explain why tests should be run with tox, update the
  baseline environments, and describe the changelog entry format.
* pre-commit: lint RELEASING.rst and the docs with the rst hook, which
  still referred to HOWTORELEASE.rst and a changelog/ directory.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nicoddemus
nicoddemus merged commit 1916b14 into pytest-dev:main Oct 17, 2026
18 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.

1 participant