fix ordering when mock.patch or other standard decorator-wrappings

are used with test methods.  This fixues issue346.  Thanks to
Ronny Pfannschmidt and Donald Stufft for helping to isolate it.
This commit is contained in:
holger krekel
2013-11-19 23:22:27 +01:00
parent 9b21d3f206
commit 0a8b27ff49
4 changed files with 51 additions and 8 deletions
-7
View File
@@ -697,11 +697,4 @@ class Session(FSCollector):
yield x
node.ihook.pytest_collectreport(report=rep)
def getfslineno(obj):
# xxx let decorators etc specify a sane ordering
if hasattr(obj, 'place_as'):
obj = obj.place_as
fslineno = py.code.getfslineno(obj)
assert isinstance(fslineno[1], int), obj
return fslineno