comparison tests/test.py @ 7:4d1852cfc077

rudimentary test for directory server
author Jeff Hammel <jhammel@mozilla.com>
date Wed, 29 Feb 2012 14:48:53 -0800
parents 623358c3ebde
children f00fcf6d9f1d
comparison
equal deleted inserted replaced
6:623358c3ebde 7:4d1852cfc077
20 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error) 20 doctest_args = dict(extraglobs=extraglobs, raise_on_error=raise_on_error)
21 if report_first: 21 if report_first:
22 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE 22 doctest_args['optionflags'] = doctest.REPORT_ONLY_FIRST_FAILURE
23 23
24 # gather tests 24 # gather tests
25 tests = [ test for test in os.listdir(directory) 25 tests = [test for test in os.listdir(directory)
26 if test.endswith('.txt') ] 26 if test.endswith('.txt')]
27 27
28 # run the tests 28 # run the tests
29 for test in tests: 29 for test in tests:
30 try: 30 try:
31 results[test] = doctest.testfile(test, **doctest_args) 31 results[test] = doctest.testfile(test, **doctest_args)