diff tests/test_util.py @ 727:e830b592917b

tests: fix test skipping in pure unittest
author Augie Fackler <durin42@gmail.com>
date Fri, 08 Oct 2010 13:58:26 -0500
parents a19a208c085b
children e24fb3e27ec9
line wrap: on
line diff
--- a/tests/test_util.py
+++ b/tests/test_util.py
@@ -100,15 +100,17 @@ FIXTURES = os.path.join(os.path.abspath(
 
 
 def _makeskip(name, message):
-    def skip(*args, **kwargs):
-        raise SkipTest(message)
-    skip.__name__ = name
-    return skip
-
+    if SkipTest:
+        def skip(*args, **kwargs):
+            raise SkipTest(message)
+        skip.__name__ = name
+        return skip
 
 def requiresmodule(mod):
     """Skip a test if the specified module is not None."""
     def decorator(fn):
+        if fn is None:
+            return
         if mod is not None:
             return fn
         return _makeskip(fn.__name__, 'missing required feature')