[TIP] Docstrings in Test methods

Mike Pirnat mpirnat at gmail.com
Sat Nov 5 06:05:37 PDT 2011


I work in a pretty big codebase with a lot of developers.  We prefer
not having a docstring on our tests so that when they do fail, we can
quickly identify what test it is (and who the best people to fix it
are going to be).

Our compromise in the sake of explaining a test is to use a comment
where we would otherwise have a docstring in production code.

I would be all for using docstrings for consistency with our
production code if the test runner wouldn't replace the test
module/class/method with the docstring in its output.

-- 
Mike Pirnat
mpirnat at gmail.com
http://www.pirnat.com/



More information about the testing-in-python mailing list