forked from jeztek/imok_appengine
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest_docs.py
35 lines (27 loc) · 851 Bytes
/
test_docs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# -*- coding: ascii -*-
import unittest, os, os.path, sys
from doctest import DocTestSuite
# We test the documentation this way instead of using DocFileSuite so
# we can run the tests under Python 2.3
def test_README():
pass
this_dir = os.path.dirname(__file__)
locs = [
os.path.join(this_dir, os.pardir, 'README.txt'),
os.path.join(this_dir, os.pardir, os.pardir, 'README.txt'),
]
for loc in locs:
if os.path.exists(loc):
test_README.__doc__ = open(loc).read()
break
if test_README.__doc__ is None:
raise RuntimeError('README.txt not found')
README = DocTestSuite()
def test_suite():
"For the Z3 test runner"
return README
if __name__ == '__main__':
sys.path.insert(0, os.path.abspath(os.path.join(
this_dir, os.pardir, os.pardir
)))
unittest.main(defaultTest='README')