Posted By

stoyan on 09/29/08


testing python doctest docutils

Versions (?)

Who likes this?

1 person have marked this snippet as a favorite


Running Doctest/Docutils

 / Published in: Python


This is going to run all doctests for all methods in a module. Doctests are a beautiful thing. Note: doctest will only complain if a test fails. If you see on output then all your tests must have passed.

  1. def add(x,y):
  2. """
  3. >>> add(5,6)
  4. 11
  5. """
  6. return x+y
  8. if __name__ == "__main__":
  9. import doctest
  10. doctest.testmod()

Report this snippet  


RSS Icon Subscribe to comments
Posted By: jim on September 29, 2008

OMG this is so awsome thx

You need to login to post a comment.