summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorIan Bicking <ian@ianbicking.org>2007-06-13 02:59:54 +0000
committerIan Bicking <ian@ianbicking.org>2007-06-13 02:59:54 +0000
commit32e2f6a2d5940adf1a78a7b618e3f1c2090f8edb (patch)
treeb6beb557e5e8648ab46ece3b80ab096b06eb2848 /tests
parente5cd25ffb3a583f3b2f72e04f189adbbcf1faba7 (diff)
downloadpaste-git-32e2f6a2d5940adf1a78a7b618e3f1c2090f8edb.tar.gz
Add a little helper to run doctests
Diffstat (limited to 'tests')
-rw-r--r--tests/test_doctests.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/tests/test_doctests.py b/tests/test_doctests.py
index bdbe2b1..875fbc2 100644
--- a/tests/test_doctests.py
+++ b/tests/test_doctests.py
@@ -49,3 +49,12 @@ def do_doctest_mod(module):
failure, total = doctest.testmod(
module, optionflags=options)
assert not failure, "Failure in %r" % module
+
+if __name__ == '__main__':
+ import sys
+ import doctest
+ args = sys.argv[1:]
+ if not args:
+ args = filenames
+ for filename in args:
+ doctest.testfile(filename, module_relative=False)