Changeset 328 for pyyaml/trunk/tests3/test_appliance.py
- Timestamp:
- 12/29/08 12:24:05 (4 years ago)
- Location:
- pyyaml/trunk/tests3
- Files:
-
- 1 edited
- 1 copied
-
. (copied) (copied from pyyaml/trunk/tests)
-
test_appliance.py (modified) (7 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pyyaml/trunk/tests3/test_appliance.py
r325 r328 2 2 import sys, os, os.path, types, traceback, pprint 3 3 4 DATA = 'tests /data'4 DATA = 'tests3/data' 5 5 6 6 def find_test_functions(collections): … … 11 11 if not isinstance(collection, dict): 12 12 collection = vars(collection) 13 keys = collection.keys() 14 keys.sort() 15 for key in keys: 13 for key in sorted(collection): 16 14 value = collection[key] 17 15 if isinstance(value, types.FunctionType) and hasattr(value, 'unittest'): … … 25 23 base, ext = os.path.splitext(filename) 26 24 filenames.setdefault(base, []).append(ext) 27 filenames = filenames.items() 28 filenames.sort() 25 filenames = sorted(filenames.items()) 29 26 return filenames 30 27 … … 52 49 53 50 def execute(function, filenames, verbose): 54 if hasattr(function, 'unittest_name'): 55 name = function.unittest_name 56 else: 57 name = function.func_name 51 name = function.__name__ 58 52 if verbose: 59 53 sys.stdout.write('='*75+'\n') … … 61 55 try: 62 56 function(verbose=verbose, *filenames) 63 except Exception ,exc:57 except Exception as exc: 64 58 info = sys.exc_info() 65 59 if isinstance(exc, AssertionError): … … 107 101 sys.stdout.write('-'*75+'\n') 108 102 sys.stdout.write('%s:\n' % filename) 109 data = open(filename, 'r b').read()103 data = open(filename, 'r', errors='replace').read() 110 104 sys.stdout.write(data) 111 105 if data and data[-1] != '\n': … … 124 118 results = [] 125 119 for function in test_functions: 126 if include_functions and function. func_namenot in include_functions:120 if include_functions and function.__name__ not in include_functions: 127 121 continue 128 122 if function.unittest:
Note: See TracChangeset
for help on using the changeset viewer.
