def myfun(a, b): """ >>> myfun(2,3) 5 >>> myfun(4,3) 7 """ return a+b if __name__ == '__main__': import doctest doctest.testmod()
Showing posts with label doctest. Show all posts
Showing posts with label doctest. Show all posts
Thursday, April 25, 2013
Doctest in python
The doctest module searches for pieces of text that look like interactive Python sessions in docstrings, and then executes those sessions to verify that they work exactly as shown.
If test failed it will shows proper message.
Posted by
Abu Zahed Jony
at
1:51 AM
0
comments
Email ThisBlogThis!Share to XShare to FacebookShare to Pinterest

Subscribe to:
Posts (Atom)