[svn r39995] Possibly controversial checkin.

Kill a hack for explicit isinstance(). We've got just two methods,
so doing full getmro doesn't seem to make too much sense.

Anyway this changes semantics slightly, so now we rely on exact
inheritance rather than name (I don't have good answer for those)

--HG--
branch : trunk
This commit is contained in:
fijal 2007-03-06 19:06:37 +01:00
parent 91d7ced4eb
commit 34a4991edd
1 changed files with 9 additions and 5 deletions

View File

@ -42,11 +42,15 @@ class TerminalSession(Session):
cls = getattr(colitem, '__class__', None)
if cls is None:
return
for typ in py.std.inspect.getmro(cls):
meth = getattr(self, 'start_%s' % typ.__name__, None)
if meth:
meth(colitem)
break
if issubclass(cls, py.test.collect.Module):
self.start_Module(colitem)
elif issubclass(cls, py.test.collect.Item):
self.start_Item(colitem)
#for typ in py.std.inspect.getmro(cls):
# meth = getattr(self, 'start_%s' % typ.__name__, None)
# if meth:
# meth(colitem)
# break
colitem.start = py.std.time.time()
def start_Module(self, colitem):