Mike Bayer  committed c2373ce

- add py.test settings
- fix this update_wrapper thing so tests are reported nicely

  • Participants
  • Parent commits c314ecf
  • Branches master

Comments (0)

Files changed (3)

File mako/

 from mako import compat
 import operator
-def function_named(fn, name):
-    """Return a function with a given __name__.
-    Will assign to __name__ and return the original function if possible on
-    the Python implementation, otherwise a new function will be constructed.
-    """
-    fn.__name__ = name
-    return fn
+def update_wrapper(decorated, fn):
+    decorated.__wrapped__ = fn
+    decorated.__name__ = fn.__name__
+    return decorated
 class PluginLoader(object):
 universal = 1
+addopts= --tb native -v -r fxX
 sign = 1
 identity = C4DAFEE1

File test/

 import unittest
 import os
 from mako.compat import py3k, py26, py25
-from mako.util import function_named
+from mako.util import update_wrapper
 import re
 from mako.cache import CacheImpl, register_plugin
 from nose import SkipTest
                 raise SkipTest(msg)
                 return fn(*args, **kw)
-        return function_named(maybe, fn_name)
+        return update_wrapper(maybe, fn)
     return decorate
 def requires_python_3(fn):
             return fn(*arg, **kw)
-    return function_named(go, fn.__name__)
+    return update_wrapper(go, fn)
 class PlainCacheImpl(CacheImpl):
     """Simple memory cache impl so that tests which