[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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user