I've always liked #Python doctests so I was sad when I realized my doctest hack in my Django project's test suite had silently stopped working.

Happily, I've fixed it. TLDR: I now use `doctest.run_docstring_examples` from a wrapper test in my unit test suite.

Follow

@pbx I'm a fan of doctests too! Primarly I like how they provide a bit of usability documentation right there in the docstring.

@Wraptile Indeed. A few years ago I got permission from a previous employer to open-source a system I had built for them. I hadn't touched it in many years but the doctests brought it all back!

Sign in to participate in the conversation
Mastodon for Tech Folks

This Mastodon instance is for people interested in technology. Discussions aren't limited to technology, because tech folks shouldn't be limited to technology either!