3-5 July 2006
CERN, Geneva
Europe/Zurich timezone

Literate testing with doctests

3 Jul 2006, 11:00
40-SS-C01 (CERN, Geneva)


CERN, Geneva

Agile Development Agile Development


Mr Marius Gedminas (Programmers of Vilnius)


Doctests are one way of writing automated tests in Python. Doctests can be used for many purposes. I will demonstrate (with examples) the use of doctests for documentation, design, unit testing, and functional/acceptance testing. I will show some interesting features of the doctest module such as pattern matching or diffing. I will show how to collect and aggregate doctests into unittest-compatible test suites. I will talk about certain caveats and demonstrate some useful techniques for writing the tests themselves. About the author: Marius has been writing Python code for the last 4.5 years non-stop. He is deeply convinced about the gains of automated tests, and thinks that if you do not already write doctests for your Python code, then you should start doing so.

Primary author

Mr Marius Gedminas (Programmers of Vilnius)

Presentation Materials