Hacker News new | ask | show | jobs
by masklinn 2043 days ago
I'd guess their coworkers decided to write all tests as doctests, rather than use doctests to ensure examples run fine?

Python's doctests are also formatted and in some ways behaving like an interactive shell session, with

    >>> code here
    output here
rather than just "literate code" so the execution context is a bit strange. This makes complicated doctests hard to inspect and debug. Doubly so because there's almost no tooling which understands doctests.

And of course on the flip side the best tests make for absolutely terrible examples since they try to exercise weird corner cases.