Source

pyyaml / tests / test_appliance.py

Diff from to

File tests/test_appliance.py

     return include_functions, include_filenames, verbose
 
 def execute(function, filenames, verbose):
+    if hasattr(function, 'unittest_name'):
+        name = function.unittest_name
+    else:
+        name = function.func_name
     if verbose:
         sys.stdout.write('='*75+'\n')
-        sys.stdout.write('%s(%s)...\n' % (function.func_name, ', '.join(filenames)))
+        sys.stdout.write('%s(%s)...\n' % (name, ', '.join(filenames)))
     try:
         function(verbose=verbose, *filenames)
     except Exception, exc:
         if not verbose:
             sys.stdout.write('.')
     sys.stdout.flush()
-    return (function, filenames, kind, info)
+    return (name, filenames, kind, info)
 
 def display(results, verbose):
     if results and not verbose:
     total = len(results)
     failures = 0
     errors = 0
-    for function, filenames, kind, info in results:
+    for name, filenames, kind, info in results:
         if kind == 'SUCCESS':
             continue
         if kind == 'FAILURE':
         if kind == 'ERROR':
             errors += 1
         sys.stdout.write('='*75+'\n')
-        sys.stdout.write('%s(%s): %s\n' % (function.func_name, ', '.join(filenames), kind))
+        sys.stdout.write('%s(%s): %s\n' % (name, ', '.join(filenames), kind))
         if kind == 'ERROR':
             traceback.print_exception(file=sys.stdout, *info)
         else:
             sys.stdout.write('%s: see below\n' % info[0].__name__)
             sys.stdout.write('~'*75+'\n')
             for arg in info[1].args:
-                pprint.pprint(arg, stream=sys.stdout, indent=2)
+                pprint.pprint(arg, stream=sys.stdout)
         for filename in filenames:
             sys.stdout.write('-'*75+'\n')
             sys.stdout.write('%s:\n' % filename)