def test():
import doctest
doctest.testfile('iso2709_test.txt')
python类testfile()的实例源码
def test_doctest_show_scroll(self):
print('... display show and scroll doctests - be patient! ...')
doctest.testfile(TestDisplay.__DOCTEST_FILE)
def test_doctest_show_scroll(self):
print('... display show and scroll doctests - be patient! ...')
doctest.testfile(TestDisplay.__DOCTEST_FILE)
def testDoc(filename, name=None):
print("--- %s: Run tests" % filename)
failure, nb_test = testfile(
filename, optionflags=ELLIPSIS, name=name)
if failure:
exit(1)
print("--- %s: End of tests" % filename)