Jan-04-2018, 07:34 PM
In the standard lib, there's unit tests: https://docs.python.org/3/library/unittest.html
and doc tests: https://docs.python.org/3/library/doctest.html
Doc tests are useful if you have a tool that builds documentation for you (such as Sphinx http://www.sphinx-doc.org/en/stable/), so you know your examples are still accurate. Unit tests are probably more useful in general, though.
and doc tests: https://docs.python.org/3/library/doctest.html
Doc tests are useful if you have a tool that builds documentation for you (such as Sphinx http://www.sphinx-doc.org/en/stable/), so you know your examples are still accurate. Unit tests are probably more useful in general, though.