Ross ROSS = Recommend OSS · open-source software intelligence for agents

pytest-dev/pytest-mock

Some data may be outdated — see provenance labels.

Thin-wrapper around the mock package for easier use with pytest observed · 2026-09-26

github.com/pytest-dev/pytest-mock · homepage · Python · MIT (permissive) observed · 2026-09-26

Health v2 · maintenance only

73/100

  • Activity 96
  • Release rhythm 29
  • Longevity 100
How is this computed?

round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10) — computed 2026-10-21. Adoption (stars, forks) is never an input.

  • gap_med: 56.0
  • age_days: 4479
  • days_rel: 399
  • days_push: 27
  • n_releases_24m: 3

Full methodology

Adoption not part of the score

2041 stars · 174 forks observed · 2026-09-26

What it is AI-extracted, prompt v1, taxonomy v1, 2026-08-30, confidence not recorded

A pytest plugin that provides a `mocker` fixture wrapping the mock package's patching API. It automatically undoes mocks after each test and adds utilities like spy and stub with pytest-style introspection.

Use cases

  • mock functions in pytest tests
  • patch os.remove in a unit test
  • spy on method calls during testing
  • create stubs for pytest test cases
  • automatically undo patches after each test
  • replace unittest.mock boilerplate in pytest

When to choose

  • you write tests with pytest and need mocking
  • you want automatic patch cleanup between tests
  • you prefer a fixture-based API over context managers and decorators

When to avoid

  • you don't use pytest as your test runner
  • you need mocking features outside of pytest
  • you already prefer raw unittest.mock with no wrapper

Facets

plugin · maturity stable

mocking testing testing developer-tools python cli pytest-plugin pytest-fixture test-doubles spy stub

2 sources

Member repositories

RepositoryRoleHealth v2
pytest-dev/pytest-mockmain73

For agents

markdown · JSON · MCP: product_card(name="pytest-dev/pytest-mock")

Data as of 2026-10-19T08:05:51.212177+00:00 · Report a problem