We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d8ccc43 commit 45d87a4Copy full SHA for 45d87a4
doctests.py
@@ -13,9 +13,11 @@
13
14
if __name__ == "__main__":
15
import sys, glob, doctest
16
- args = sys.argv[1:]
+ args = [arg for arg in sys.argv[1:] if arg != '-v']
17
+ if not args: args = ['*.py']
18
modules = [__import__(name.replace('.py',''))
- for arg in args if arg != "-v" for name in glob.glob(arg)]
19
+ for arg in args for name in glob.glob(arg)]
20
for module in modules:
21
doctest.testmod(module, report=1, optionflags=doctest.REPORT_UDIFF)
- print '%d failed out of %d' % doctest.master.summarize()
22
+ summary = doctest.master.summarize() if modules else (0, 0)
23
+ print '%d failed out of %d' % summary
0 commit comments