[svn r60142] - experimental support to let decorators used on tests specify a saner order by attaching the original function (we have been

using something like this for quite a while at OE)
- make the explicit names test more paranoid

--HG--
branch : trunk
This commit is contained in:
pedronis
2008-11-25 20:15:01 +01:00
parent 1a150e9050
commit 6ec13a2b9c
2 changed files with 34 additions and 8 deletions

View File

@@ -60,16 +60,20 @@ class PyobjMixin(object):
return self._fslineno
except AttributeError:
pass
obj = self.obj
# let decorators etc specify a sane ordering
if hasattr(obj, 'place_as'):
obj = obj.place_as
try:
code = py.code.Code(self.obj)
code = py.code.Code(obj)
except TypeError:
# fallback to
fn = (py.std.inspect.getsourcefile(self.obj) or
py.std.inspect.getfile(self.obj))
fn = (py.std.inspect.getsourcefile(obj) or
py.std.inspect.getfile(obj))
fspath = fn and py.path.local(fn) or None
if fspath:
try:
_, lineno = findsource(self.obj)
_, lineno = findsource(obj)
except IOError:
lineno = None
else: