def test_rst_files(self): for filename in glob('./tests/rst/*.rst'): filename = os.path.abspath(filename) failures, tests = doctest2.testfile(filename, module_relative=False, verbose=False) self.assertTrue(failures == 0)
#!/usr/bin/env python """Run all tests. """ from glob import glob import doctest2 import sys def summarize(filename, statuses): print("=" * 30) print(filename) print("-" * 30) failures, tests = statuses print("%d tests, %d failures" % (tests, failures)) print("=" * 30) print("") if __name__ == '__main__': if len(sys.argv) > 1 and sys.argv[1] == '-v': verbose = True else: verbose = False summarize('doctest2.py', doctest2.testmod(doctest2)) for filename in glob('./tests/rst/*.rst'): summarize(filename, doctest2.testfile(filename, verbose=verbose))
def test_rst_files(self): for filename in glob('./tests/rst/*.rst'): filename = os.path.abspath(filename) failures, tests = doctest2.testfile( filename, module_relative=False, verbose=False) self.assertTrue(failures == 0)