[py-svn] r56652 - py/branch/event/py/test2/rep
hpk at codespeak.net
hpk at codespeak.net
Fri Jul 18 23:31:35 CEST 2008
Author: hpk
Date: Fri Jul 18 23:31:34 2008
New Revision: 56652
Modified:
py/branch/event/py/test2/rep/terminal.py
Log:
nicefy py.test2 output a bit
Modified: py/branch/event/py/test2/rep/terminal.py
==============================================================================
--- py/branch/event/py/test2/rep/terminal.py (original)
+++ py/branch/event/py/test2/rep/terminal.py Fri Jul 18 23:31:34 2008
@@ -1,3 +1,4 @@
+import py
import sys
from py.__.test2 import repevent
@@ -6,13 +7,19 @@
self.config = config
self.config.bus.subscribe(self.consume)
self.currentfspath = None
+ self.out = py.io.TerminalWriter(sys.stdout)
def consume(self, ev):
if isinstance(ev, repevent.ItemTestReport):
fspath, modpath = ev.repr_path
if fspath != self.currentfspath:
- print
- sys.stdout.write(fspath)
+ self.out.line()
+ self.out.write(fspath)
self.currentfspath = fspath
- sys.stdout.write(".")
- sys.stdout.flush()
+ self.out.write(".")
+ elif isinstance(ev, repevent.SessionFinish):
+ self.out.line()
+ self.out.sep("=", "finish")
+ elif isinstance(ev, repevent.SessionStart):
+ self.out.sep("=", "session starts")
+
More information about the pytest-commit
mailing list