Better Python tests with inline-snapshot

16 points by a5rocks


msw

One of the reasons I love python is because it’s so powerful and flexible that it’s easy to write this sort of thing yourself. The last time i saw a snapshot testing thread here i was inspired to write my own. Its around 10 lines of python and I’ve been using it ever since.

https://lobste.rs/s/xsquae/my_kind_repl#c_v235bi

zem

This is tedious to write and a pain to maintain. It's also not very thorough - you have no idea what other fields you're silently ignoring.

these are two separate concerns, and I would love to see an enhancement that let me write something like {'a': 1, _: ...} to say "I don't care about the rest of the container, but test and update this subset of it".