|
|
|
|
|
by dec0dedab0de
84 days ago
|
|
interesting that they don’t mention doctest which has been a python built-in for quite a while. It allows you to write simple unit tests directly in your doc strings, by essentially copying the repl output so it doubles as an example. combined with something like sphinx that is almost exactly what you’re looking for. doctest kind of sucks for anything where you need to set up state, but if you’re writing functional code it is often a quick and easy way to document and test your code/documentation at the same time. https://docs.python.org/3/library/doctest.html |
|
That system is an unit test that checks that functions are documented in the documentation. Nothing to do with docstrings.