From 34a4991edd593df70304c8da54c0d7bb11ea6eab Mon Sep 17 00:00:00 2001 From: fijal Date: Tue, 6 Mar 2007 19:06:37 +0100 Subject: [PATCH] [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 --- py/test/terminal/terminal.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/py/test/terminal/terminal.py b/py/test/terminal/terminal.py index 2d7e09b04..ffa0c17d4 100644 --- a/py/test/terminal/terminal.py +++ b/py/test/terminal/terminal.py @@ -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):