Overview
Explore the world of doctests in Python and learn how to leverage them for interactive code development and unit testing. Discover the concept of embedding examples and tests within docstrings, and gain insights into writing effective doctests. Understand how doctests facilitate test-driven development by allowing you to define "demo" inputs that can be easily copied into IPython. Delve into the technical aspects of doctest syntax, directives, parsing, and execution. Then, dive into Xdoctest, a powerful alternative to Python's built-in doctest module, which offers enhanced functionality and flexibility. Learn about the limitations of doctest's regex-based parser and how Xdoctest's ast-based parser overcomes these challenges. By the end of this talk, gain the confidence to write, run, and develop with doctests effectively, enhancing your Python development workflow.
Syllabus
Talk: Jon Crall - Developing With Doctests - Using Xdoctest As A Backend
Taught by
PyCon US