{"slug": "pytest", "name": "pytest", "category": "dev-libs", "category_name": "Libraries and frameworks", "description": "", "recommenders": 1, "commenters": 4, "warners": 0, "score": 1.621, "rising": -0.33, "first": "2025-12-07", "latest": "2026-08-01", "why": "I immediately set up up ruff, ty, pytest, pre-commit hook", "why_is_quote": true, "has_verdict": false, "sentiment": {"recommend": 1, "neutral": 3, "compare": 0, "warn": 0}, "spark": [0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0], "listed": false, "loved": [], "caveat": "", "short_quote": "I immediately set up up ruff, ty, pytest, pre-commit hook", "icon": false, "domain": null, "github_repo": null, "official_url": "", "pricing": "", "aliases": ["pytest"], "verdict": null, "praise": [{"label": "", "summary": "", "quotes": [{"id": 748723990, "item_id": 46795249, "url": "https://news.ycombinator.com/item?id=46795249", "by": "senko", "date": "2026-01-28", "stance": "recommend", "quote": "I immediately set up up ruff, ty, pytest, pre-commit hook", "excerpt": "Some more Django recommendations from Frank Wiles of Revsys (Django consultancy): https://frankwiles.com/questions/starting-django-projects/ I'll add a few of my own: * Set up the project using uv * I name the django project \"project\"; so settings are project/settings.py, main urls are project/urls.py, etc * I always define a custom Django user model even if I don't need anything extra yet; easier to expand later * s", "context": "", "use_case": "testing", "switched_from": "", "story": "Notes on Starting to Use Django"}]}], "caveats": [], "who": [], "tags": [], "use_cases": ["running tests", "running python tests", "running tests in agent sessions", "testing", "running unit tests"], "compared": [{"slug": "uv", "name": "uv", "co": 3, "switched_from": 0, "switched_to": 0}, {"slug": "playwright", "name": "Playwright", "co": 2, "switched_from": 0, "switched_to": 0}], "makers": [], "threads": [{"url": "https://news.ycombinator.com/item?id=47002404", "title": "I asked Claude Code to remove jQuery. It failed miserably", "mentions": 2}, {"url": "https://news.ycombinator.com/item?id=49135546", "title": "Pgtestdb's template cloning approach to testing is fast", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46788384", "title": "Notes on Starting to Use Django", "mentions": 1}, {"url": "https://news.ycombinator.com/item?id=46125963", "title": "What is \u201cliterate programming\u201d? (2024)", "mentions": 1}], "sentiment_by_month": {"2025-11": {}, "2025-12": {"neutral": 1}, "2026-01": {"recommend": 1}, "2026-02": {"neutral": 1}, "2026-03": {}, "2026-04": {}, "2026-05": {}, "2026-06": {}, "2026-07": {}, "2026-08": {"neutral": 1}, "2026-09": {}, "2026-10": {}}, "quotes": [{"id": 786196464, "item_id": 49137279, "url": "https://news.ycombinator.com/item?id=49137279", "by": "ltbarcly3", "date": "2026-08-01", "stance": "neutral", "quote": "We use pytest with xdist", "excerpt": "We use pytest with xdist and we run as many as the system it is running on can handle. On my threadripper machine with 256GB I could run about 60 concurrent tests, on my 9955hx machine I use day to day I can run 13. On a MBP I think it's about 8-16. There is diminishing returns with more processes. Each xdist process gets it's own testdb. If I was designing it from scratch I would use a single testdb and point all th", "context": "", "use_case": "running tests", "switched_from": "", "story": "Pgtestdb's template cloning approach to testing is fast"}, {"id": 752051201, "item_id": 47003200, "url": "https://news.ycombinator.com/item?id=47003200", "by": "simonw", "date": "2026-02-13", "stance": "neutral", "quote": "dev = [\"pytest\"]", "excerpt": "I don't use CLAUDE.md, I instead use simple token-efficient conventions. Most importantly all of my Python projects use a pyproject.toml file with this pattern: [dependency-groups] dev = [\"pytest\"] Which means I can tell the agent: Run \"uv run pytest\" And it will run the tests - without first needing to setup a virtual environment or install dependencies or anything like that. I wrote more about that pattern here: ht", "context": "", "use_case": "running Python tests", "switched_from": "", "story": "I asked Claude Code to remove jQuery. It failed miserably"}, {"id": 752047091, "item_id": 47002943, "url": "https://news.ycombinator.com/item?id=47002943", "by": "simonw", "date": "2026-02-13", "stance": "neutral", "quote": "I start every one of my coding agent sessions with \"run uv run pytest\"", "excerpt": "How did you have it testing its code changes? Did you tell it to use Playwright or agent-browser or anything like that? If coding agents can't test the code as they're editing it they're no different from pasting your entire codebase into ChatGPT and crossing your fingers. At one point you mention it hadn't run \"npm test\" - did it run that once you directly told it to? I start every one of my coding agent sessions wi", "context": "", "use_case": "running tests in agent sessions", "switched_from": "", "story": "I asked Claude Code to remove jQuery. It failed miserably"}, {"id": 748723990, "item_id": 46795249, "url": "https://news.ycombinator.com/item?id=46795249", "by": "senko", "date": "2026-01-28", "stance": "recommend", "quote": "I immediately set up up ruff, ty, pytest, pre-commit hook", "excerpt": "Some more Django recommendations from Frank Wiles of Revsys (Django consultancy): https://frankwiles.com/questions/starting-django-projects/ I'll add a few of my own: * Set up the project using uv * I name the django project \"project\"; so settings are project/settings.py, main urls are project/urls.py, etc * I always define a custom Django user model even if I don't need anything extra yet; easier to expand later * s", "context": "", "use_case": "testing", "switched_from": "", "story": "Notes on Starting to Use Django"}, {"id": 738941138, "item_id": 46183821, "url": "https://news.ycombinator.com/item?id=46183821", "by": "Jtsummers", "date": "2025-12-07", "stance": "neutral", "quote": "This is followed by running `pytest` (or whatever test utility) as normal.", "excerpt": "Perhaps the most prominent example of literate programming missed by the author: https://www.pbrt.org/ Physically Based Rendering by Pharr, Jakob, and Humphreys. Responding directly to a couple things the author wrote: > When programming, it\u2019s not uncommon to write a function that\u2019s \u201cgood enough for now\u201d, and revise it later. This is impossible to adequately do in literate programming. It's not impossible in literate", "context": "", "use_case": "running unit tests", "switched_from": "", "story": "What is \u201cliterate programming\u201d? (2024)"}]}