pytest
Hacker ApprovedRanked 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%
Recommended in 9 of 13 months
- November 2025: recommended
- December 2025: recommended
- January 2026: recommended
- February 2026: not recommended
- March 2026: recommended
- April 2026: recommended
- May 2026: recommended
- June 2026: recommended
- July 2026: not recommended
- August 2026: recommended
- September 2026: recommended
- October 2026: not recommended
- 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.
| Product | Recommend | Criticize | Approval | Months | Owned | Badge |
|---|---|---|---|---|---|---|
| Mockito | 19 | 13 | 59% | 3 | 4 yrs4 owners | — |
| cargo-nextest | 18 | 1 | 95% | 3 | — | — |
| Vitest | 17 | 8 | 68% | 8 | — | Approved |
| Testcontainers | 14 | 3 | 82% | 8 | — | Approved |
| pytestThis page | 12 | 5 | 71% | 9 | — | Approved |
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”
“pytest running code from the source directory by default”
“Write pytest tests with pytest.mark.parametrize, fixtures, and mocks.”
“Test with uv run pytest, use red/green TDD”
“after tightening up Pydantic + strict mypy + pytest”
“It will save you 99% of headaches.”
“pre-push will run pytest but with reduced output”
“pytest doesn't want to run this way”
“it wants too much magic to happen in terms of how the "fixtures" automatically connect together”
“do you _really_ need to stress test every obscure language feature?”
“I immediately set up up ruff, ty, pytest, pre-commit hook and GH workflow to run ruff/ty/pytest”
“there are a TON of good examples of pytest tests floating around in the training data”
“have a test suite which runs cleanly with "uv run pytest"”
“think pytest is overrated”
“so that pytest can run it through 50 rows of cryptic CMake”
“I've had the most success running Claude iteratively with mypy and pytest.”
“I have a pain point with pytest being a bit slow”
“fixtures are often good enough for coming up with multiple tests but are simple enough to implement”
Counts come from 1,795,640 Hacker News comments, November 2025 to November 2026. How we count. Report a mistake.