Hacker ApprovedDepartments

pytest

Hacker Approved

Ranked 5 of 8 testing frameworks by recommenders

Widely used Python test runner praised for fixtures, parametrized tests and easy CI setup. Critics say fixture magic is hard to follow.

Widely used Python test runner praised for fixtures, parametrized tests and easy CI setup. Critics say fixture magic is hard to follow.

17 people gave an opinion

recommend it
12
criticize it
5
approval share
71%
Each figure is one person. RecommendsCriticizes

Recommended in 9 of 13 months

  1. November 2025: recommended
  2. December 2025: recommended
  3. January 2026: recommended
  4. February 2026: not recommended
  5. March 2026: recommended
  6. April 2026: recommended
  7. May 2026: recommended
  8. June 2026: recommended
  9. July 2026: not recommended
  10. August 2026: recommended
  11. September 2026: recommended
  12. October 2026: not recommended
  13. November 2026: not recommended (month in progress)

Why it carries the badge

  • 12 people recommend itNeeds 10 or more, met.
  • 2.4 recommenders for every criticNeeds 2 to 1 or better, met.
  • Recommended in 9 of 13 monthsNeeds 4 or more, met.

The same three rules apply to every product, and the badge can’t be bought. How the badge works

What people say about it

The reasons people give, with the number of comments that give each one. Open a reason to read what they said.

Why people recommend it

Each mark is one comment

  • Runs cleanly in CI and hooks

    “I immediately set up up ruff, ty, pytest, pre-commit hook and GH workflow to run ruff/ty/pytest”

    Comment from 28 Jan 2026 in “Notes on Starting to Use Django”

    “have a test suite which runs cleanly with "uv run pytest"”

    Comment from 21 Jan 2026 in “How are you automating your coding work?”

    “pre-push will run pytest but with reduced output”

    Comment from 18 Apr 2026 in “Show HN: I built Panda to get up to 99% token savings”
  • Fixtures and parametrize make many tests easy

    “fixtures are often good enough for coming up with multiple tests but are simple enough to implement”

    Comment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

    “Write pytest tests with pytest.mark.parametrize, fixtures, and mocks.”

    Comment from 14 Jun 2026 in “"A benchmark for catching when code doesn't do what its documentation claims"”
  • Well represented in AI training data

    “there are a TON of good examples of pytest tests floating around in the training data”

    Comment from 26 Jan 2026 in “After two years of vibecoding, I'm back to writing by hand”

    “I've had the most success running Claude iteratively with mypy and pytest.”

    Comment from 10 Dec 2025 in “If you're going to vibe code, why not do it in C?”

What people warn about

Each mark is one comment

  • Awkward with non-standard project layouts

    “pytest running code from the source directory by default”

    Comment from 11 Sep 2026 in “Working with Git Worktrees in Magit”

    “pytest doesn't want to run this way”

    Comment from 2 Apr 2026 in “Bringing Clojure programming to Enterprise (2021)”

Other testing frameworks people recommend

The four most recommended other testing frameworks, with the same counts for each, so you can compare like for like. The tick on each bar marks the 2 to 1 line the badge needs.

pytest compared with 4 alternatives
ProductRecommendCriticizeApprovalMonthsOwnedBadge
Mockito191359%34 yrs4 owners—
cargo-nextest18195%3——
Vitest17868%8—Approved
Testcontainers14382%8—Approved
pytestThis page12571%9—Approved
See all 8 testing frameworks, ranked

What people said

18 of the 19 comments that mention it, newest first. Each links to the original comment.

“Playwright e2e tests are harder to maintain than pytest code”

RecommendsComment from 17 Sep 2026 in “This Code Is CRAP (2011)”

“pytest running code from the source directory by default”

CriticizesComment from 11 Sep 2026 in “Working with Git Worktrees in Magit”

“Write pytest tests with pytest.mark.parametrize, fixtures, and mocks.”

RecommendsComment from 14 Jun 2026 in “"A benchmark for catching when code doesn't do what its documentation claims"”

“Test with uv run pytest, use red/green TDD”

RecommendsComment from 5 Jun 2026 in “Agent Skill for TDD”

“after tightening up Pydantic + strict mypy + pytest”

RecommendsComment from 18 May 2026 in “Ask HN: Is Java the ideal language for LLM-assisted coding?”

“It will save you 99% of headaches.”

RecommendsComment from 12 May 2026 in “If AI Writes Your Code, Why Use Python?”

“pre-push will run pytest but with reduced output”

RecommendsComment from 18 Apr 2026 in “Show HN: I built Panda to get up to 99% token savings”

“pytest doesn't want to run this way”

CriticizesComment from 2 Apr 2026 in “Bringing Clojure programming to Enterprise (2021)”

“it wants too much magic to happen in terms of how the "fixtures" automatically connect together”

MixedComment from 18 Mar 2026 in “Python 3.15's JIT is now back on track”

“do you _really_ need to stress test every obscure language feature?”

CriticizesComment from 18 Mar 2026 in “Python 3.15's JIT is now back on track”

“I immediately set up up ruff, ty, pytest, pre-commit hook and GH workflow to run ruff/ty/pytest”

RecommendsComment from 28 Jan 2026 in “Notes on Starting to Use Django”

“there are a TON of good examples of pytest tests floating around in the training data”

RecommendsComment from 26 Jan 2026 in “After two years of vibecoding, I'm back to writing by hand”

“have a test suite which runs cleanly with "uv run pytest"”

RecommendsComment from 21 Jan 2026 in “How are you automating your coding work?”

“think pytest is overrated”

CriticizesComment from 11 Jan 2026 in “An Honest Review of Go”

“so that pytest can run it through 50 rows of cryptic CMake”

MixedComment from 18 Dec 2025 in “Slowness is a virtue”

“I've had the most success running Claude iteratively with mypy and pytest.”

RecommendsComment from 10 Dec 2025 in “If you're going to vibe code, why not do it in C?”

“I have a pain point with pytest being a bit slow”

CriticizesComment from 12 Nov 2025 in “Ask HN: What Are You Working On? (Nov 2025)”

“fixtures are often good enough for coming up with multiple tests but are simple enough to implement”

RecommendsComment from 5 Nov 2025 in “Hypothesis: Property-Based Testing for Python”

Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.