1 | """" |
---|
2 | This script runs the doctests |
---|
3 | """ |
---|
4 | import testlib |
---|
5 | import os, unittest, doctest |
---|
6 | from genetrack import data, hdflib |
---|
7 | |
---|
8 | def codetest(): |
---|
9 | "Test the code here before adding to doctest" |
---|
10 | pass |
---|
11 | |
---|
12 | def get_suite(): |
---|
13 | suite = unittest.TestSuite() |
---|
14 | |
---|
15 | file_names = [ |
---|
16 | |
---|
17 | ] |
---|
18 | |
---|
19 | module_names = [ |
---|
20 | data, hdflib |
---|
21 | ] |
---|
22 | |
---|
23 | # needs relative paths for some reason |
---|
24 | full_path = lambda name: os.path.join( '../docs/rest', name) |
---|
25 | file_paths = map( full_path, file_names) |
---|
26 | |
---|
27 | for file_path in file_paths: |
---|
28 | rest_suite = doctest.DocFileSuite( file_path ) |
---|
29 | suite.addTest( rest_suite ) |
---|
30 | |
---|
31 | for mod in module_names: |
---|
32 | docsuite = doctest.DocTestSuite( mod ) |
---|
33 | suite.addTest( docsuite ) |
---|
34 | |
---|
35 | return suite |
---|
36 | |
---|
37 | if __name__ == '__main__': |
---|
38 | #codetest() |
---|
39 | suite = get_suite() |
---|
40 | runner = unittest.TextTestRunner(verbosity=2) |
---|
41 | runner.run(suite) |
---|