equal
deleted
inserted
replaced
20 import sys |
20 import sys |
21 import os |
21 import os |
22 |
22 |
23 |
23 |
24 current_dir = os.path.abspath(os.path.dirname(__file__)) |
24 current_dir = os.path.abspath(os.path.dirname(__file__)) |
|
25 |
25 |
26 |
26 def doc_suite(test_dir, globs=None): |
27 def doc_suite(test_dir, globs=None): |
27 """Returns a test suite, based on doc tests strings found in /*.py""" |
28 """Returns a test suite, based on doc tests strings found in /*.py""" |
28 suite = [] |
29 suite = [] |
29 if globs is None: |
30 if globs is None: |
52 suite.append(doctest.DocTestSuite(location, optionflags=flags, |
53 suite.append(doctest.DocTestSuite(location, optionflags=flags, |
53 globs=globs)) |
54 globs=globs)) |
54 |
55 |
55 return unittest.TestSuite(suite) |
56 return unittest.TestSuite(suite) |
56 |
57 |
|
58 |
57 def test_suite(): |
59 def test_suite(): |
58 """returns the test suite""" |
60 """returns the test suite""" |
59 return doc_suite(current_dir) |
61 return doc_suite(current_dir) |
60 |
62 |
|
63 |
61 if __name__ == '__main__': |
64 if __name__ == '__main__': |
62 unittest.main(defaultTest='test_suite') |
65 unittest.main(defaultTest='test_suite') |