[py-svn] r39995 - py/trunk/py/test/terminal
fijal at codespeak.net
fijal at codespeak.net
Tue Mar 6 19:06:38 CET 2007
Author: fijal
Date: Tue Mar 6 19:06:37 2007
New Revision: 39995
Modified:
py/trunk/py/test/terminal/terminal.py
Log:
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)
Modified: py/trunk/py/test/terminal/terminal.py
==============================================================================
--- py/trunk/py/test/terminal/terminal.py (original)
+++ py/trunk/py/test/terminal/terminal.py Tue Mar 6 19:06:37 2007
@@ -42,11 +42,15 @@
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):
More information about the py-svn
mailing list