[py-svn] r56643 - py/branch/event/py/test2
hpk at codespeak.net
hpk at codespeak.net
Fri Jul 18 17:30:47 CEST 2008
Author: hpk
Date: Fri Jul 18 17:30:47 2008
New Revision: 56643
Modified:
py/branch/event/py/test2/executor.py
py/branch/event/py/test2/item.py
py/branch/event/py/test2/session.py
Log:
emit ItemTestReport events from the main loop.
simplify executor.
Modified: py/branch/event/py/test2/executor.py
==============================================================================
--- py/branch/event/py/test2/executor.py (original)
+++ py/branch/event/py/test2/executor.py Fri Jul 18 17:30:47 2008
@@ -19,11 +19,6 @@
self.config = config
self.outerr = None
- def setup_and_run(self):
- testrep = self.execute()
- self.config.bus.notify(testrep)
- return testrep
-
def runitem(self):
capture = self.config._getcapture(path=self.item.fspath)
try:
@@ -81,6 +76,9 @@
def cont(waiter=os.waitpid):
parent(pid, waiter=waiter)
return self.maketestreport(b)
+
+ # XXX does not follow normal execute() signature!
+ # thus cannot be used like this anyway
return cont, pid
class ApigenExecutor(RunExecutor):
Modified: py/branch/event/py/test2/item.py
==============================================================================
--- py/branch/event/py/test2/item.py (original)
+++ py/branch/event/py/test2/item.py Fri Jul 18 17:30:47 2008
@@ -47,7 +47,7 @@
def runtest(self):
from py.__.test2.executor import getexecutor
executor = getexecutor(self, self._config)
- return executor.setup_and_run()
+ return executor.execute()
class Function(FunctionMixin, Item):
""" a Function Item is responsible for setting up
Modified: py/branch/event/py/test2/session.py
==============================================================================
--- py/branch/event/py/test2/session.py (original)
+++ py/branch/event/py/test2/session.py Fri Jul 18 17:30:47 2008
@@ -77,7 +77,8 @@
if self.shouldstop:
break
if not self.config.option.collectonly:
- self.runtest(item)
+ testrep = self.runtest(item)
+ self.config.bus.notify(testrep)
finally:
failures = self.sessionfinishes()
return failures
More information about the pytest-commit
mailing list