Kirill Simonov avatar Kirill Simonov committed 2e013ad

Minor 2.3 and win32 compatibility fixes; clarify the 'feature not found' message in setup.py.

Comments (0)

Files changed (5)

                     extra_postargs=(ext.extra_compile_args or []),
                     depends=ext.depends)
         except CompileError:
-            log.warn("%s appears not to be installed" % ext.feature_name)
+            log.warn("%s appears not to be installed: forcing --%s"
+                     % (ext.feature_name, ext.neg_option_name))
             log.warn("(if %s is installed, you may need to specify"
                     % ext.feature_name)
             log.warn(" the option --include-dirs or uncomment and modify")

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)

tests/test_constructor.py

         return repr(data.utctimetuple())
     elif isinstance(data, unicode):
         return data.encode('utf-8')
+    elif isinstance(data, float) and data != data:
+        return '?'
     else:
         return str(data)
 

tests/test_recursive.py

         assert output1 == output2, (output1, output2)
     finally:
         if verbose:
-            print "VALUE1:", value1
-            print "VALUE2:", value2
+            #print "VALUE1:", value1
+            #print "VALUE2:", value2
             print "OUTPUT1:"
             print output1
             print "OUTPUT2:"

tests/test_yaml_ext.py

             function(*args, **kwds)
         finally:
             _tear_down()
-    wrapper.func_name = '%s_ext' % function.func_name
+    try:
+        wrapper.func_name = '%s_ext' % function.func_name
+    except TypeError:
+        pass
+    wrapper.unittest_name = '%s_ext' % function.func_name
     wrapper.unittest = function.unittest
     wrapper.skip = getattr(function, 'skip', [])+['.skip-ext']
     return wrapper
             if isinstance(value, types.FunctionType) and hasattr(value, 'unittest'):
                 functions.append(wrap_ext_function(value))
     for function in functions:
-        assert function.func_name not in globals()
-        globals()[function.func_name] = function
+        assert function.unittest_name not in globals()
+        globals()[function.unittest_name] = function
 
 import test_tokens, test_structure, test_errors, test_resolver, test_constructor,   \
         test_emitter, test_representer, test_recursive
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.