equal
deleted
inserted
replaced
14 Generic Test case for pyams_viewlet doc strings |
14 Generic Test case for pyams_viewlet doc strings |
15 """ |
15 """ |
16 |
16 |
17 import doctest |
17 import doctest |
18 import os |
18 import os |
19 import sys |
|
20 import unittest |
19 import unittest |
|
20 |
|
21 from pyams_viewlet.tests import get_package_dir |
21 |
22 |
22 |
23 |
23 __docformat__ = 'restructuredtext' |
24 __docformat__ = 'restructuredtext' |
24 |
25 |
25 CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) |
26 CURRENT_DIR = os.path.abspath(os.path.dirname(__file__)) |
32 globs = globals() |
33 globs = globals() |
33 |
34 |
34 flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | |
35 flags = (doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE | |
35 doctest.REPORT_ONLY_FIRST_FAILURE) |
36 doctest.REPORT_ONLY_FIRST_FAILURE) |
36 |
37 |
37 package_dir = os.path.split(test_dir)[0] |
38 package_dir = get_package_dir(test_dir) |
38 if package_dir not in sys.path: |
|
39 sys.path.append(package_dir) |
|
40 |
39 |
41 # filtering files on extension |
40 # filtering files on extension |
42 docs = [doc for doc in |
41 docs = [doc for doc in |
43 os.listdir(package_dir) if doc.endswith('.py')] |
42 os.listdir(package_dir) if doc.endswith('.py')] |
44 docs = [doc for doc in docs if not doc.startswith('__')] |
43 docs = [doc for doc in docs if not doc.startswith('__')] |