python Programming Glossary: doctest
Python hashable dicts http://stackoverflow.com/questions/1151658/python-hashable-dicts result right return result if __name__ __main__ import doctest doctest.testmod python share improve this question Here.. right return result if __name__ __main__ import doctest doctest.testmod python share improve this question Here is the..
How to solve the “Mastermind” guessing game? http://stackoverflow.com/questions/1185634/how-to-solve-the-mastermind-guessing-game extensive docs with small embedded unit tests tested using doctest I can't praise this methodology highly enough as a brilliant..
Why results of map() and list comprehension are different? http://stackoverflow.com/questions/139819/why-results-of-map-and-list-comprehension-are-different a for a in args print alist if __name__ '__main__' import doctest doctest.testmod In other words t 1 1 args for i in t ... args.append.. in args print alist if __name__ '__main__' import doctest doctest.testmod In other words t 1 1 args for i in t ... args.append..
How to implement Unicode string matching by folding in python http://stackoverflow.com/questions/1410308/how-to-implement-unicode-string-matching-by-folding-in-python not transliterated. tofolded u á¼™Î»Î»Î¬Ï u' λλα ' True These doctests pass but should they fail they fail hard srcstr normalize NFKD.. in srcstr if category c 'Mn' if __name__ '__main__' import doctest doctest.testmod And for the actual matching if that interests.. if category c 'Mn' if __name__ '__main__' import doctest doctest.testmod And for the actual matching if that interests anyone..
Grouping / clustering numbers in Python http://stackoverflow.com/questions/14783947/grouping-clustering-numbers-in-python
sparse assignment list in python http://stackoverflow.com/questions/1857780/sparse-assignment-list-in-python l 5 for i in l print i None None hello None 22 ''' import doctest doctest.testmod verbose 1 I imagine you'll want more to support.. i in l print i None None hello None 22 ''' import doctest doctest.testmod verbose 1 I imagine you'll want more to support negative..
counting combinations and permutations efficiently http://stackoverflow.com/questions/2096573/counting-combinations-and-permutations-efficiently intermediate result. Without this optimization the last doctest takes too long trying to calculate factorial 99000 . Can anyone..
Python - doctest vs. unittest http://stackoverflow.com/questions/361675/python-doctest-vs-unittest doctest vs. unittest I'm trying to get started with unit testing in.. could inform me of the advantages and disadvantages of doctest and unittest. What conditions would you use each for python.. would you use each for python unit testing comparison doctest share improve this question Both are valuable. I use both..
Differences between distribute, distutils, setuptools and distutils2? http://stackoverflow.com/questions/6344076/differences-between-distribute-distutils-setuptools-and-distutils2 I need to port the current system which according to the doctest is distutils . The Problem Unfortunately I ™m not sure what ™s..
Auto generate doctest output with Sphinx extension http://stackoverflow.com/questions/9809434/auto-generate-doctest-output-with-sphinx-extension generate doctest output with Sphinx extension I think I am missing something.. I am missing something about the sphinx extension for doctest. The typical example in the documentation is .. doctest print.. doctest. The typical example in the documentation is .. doctest print 1 1 Isn't there a way to let sphinx generate the output..
|