예제 #1
0
 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)
예제 #2
0
파일: test.py 프로젝트: wapcaplet/doctest2
#!/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))
예제 #3
0
 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)
예제 #4
0
파일: test.py 프로젝트: kmike/doctest2
#!/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))