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.
I think it's between a test written inside a comment (where smart IDE features don't apply) versus `#[test]` in normal code, where you have a rich editing environment and instant feedback (including `cargo build` failing immediately on errors).
Perhaps it's just my perception, but doctests (in comments) seem slower to run.
Ah; rust-analyzer syntax highlights doc tests (though not perfectly), but the higher order bit of "IDE features don't work as well" makes tons of sense, thanks!
This is also part of my complaint. At least in Python, doctests limit the ability for the IDE to be effective.
They hinder the writer as well as the consumer, since they make it harder to write effective tests. What I am saying is, that all tests should be first class wrt the documentation.
Python's doctests are also formatted and in some ways behaving like an interactive shell session, with
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.