← Back to all articles

Ned Batchelder

Creator of coverage.py. Python community leader and Boston Python organizer.

https://nedbatchelder.com

Articles

Pytest parameter functions

Pytest’s parametrize is a great feature for writing tests without repeating yourself needlessly. (If you haven’t seen it before, read Starting with pytest’s parametrize first). When the data gets comp

EdText

I have a new small project: edtext provides text selection and manipulation functions inspired by the classic ed text editor. I’ve long used cog to build documentation and HTML presentations. Cog inte

Testing: exceptions and caches

Two testing-related things I found recently. Unified exception testing Kacper Borucki blogged about parameterizing exception testing, and linked to pytest docs and a StackOverflow answer with similar

No more .html

Site removed .html extensions from URLs after 24 years because someone said they looked outdated like files.

Generating data shapes with Hypothesis

Hypothesis can randomly generate schemas (not just data) to test a Hasher class, avoiding false positives from type mismatches like [0] vs [False].

A testing conundrum

Author creates a fingerprinting class for nested data structures but struggles to write comprehensive tests for all possible data shapes.

Autism Adulthood, 3rd edition

Susan's 3rd edition of "Autism Adulthood" features interviews with autistic adults, families & professionals, offering diverse perspectives on autism.

Why your mock breaks later

Mocking in the wrong location may work initially but breaks later when code changes, causing hard-to-debug test failures.