[svn r58092] Ensure that the path is printed before the 1st test of
a module starts running (even when -v is not specified). --HG-- branch : trunk
This commit is contained in:
parent
a9c4c9876c
commit
faec0dfa0b
|
@ -93,6 +93,11 @@ class TerminalReporter(BaseReporter):
|
|||
if ev.host:
|
||||
extra = "-> " + ev.host.hostid
|
||||
self.write_ensure_prefix(line, extra)
|
||||
else:
|
||||
# ensure that the path is printed before the 1st test of
|
||||
# a module starts running
|
||||
fspath = ev.item.fspath
|
||||
self.write_fspath_result(fspath, "")
|
||||
|
||||
def rep_RescheduleItems(self, ev):
|
||||
if self.config.option.debug:
|
||||
|
|
|
@ -192,3 +192,17 @@ class TestTerminal(InlineCollection):
|
|||
assert 'FAILURES' not in s
|
||||
assert '--calling--' not in s
|
||||
assert 'IndexError' not in s
|
||||
|
||||
def test_show_path_before_running_test(self):
|
||||
modcol = self.getmodulecol("""
|
||||
def test_foobar():
|
||||
pass
|
||||
""", withsession=True)
|
||||
stringio = py.std.cStringIO.StringIO()
|
||||
rep = TerminalReporter(modcol._config, bus=self.session.bus, file=stringio)
|
||||
l = list(self.session.genitems([modcol]))
|
||||
assert len(l) == 1
|
||||
rep.processevent(event.ItemStart(l[0]))
|
||||
s = popvalue(stringio)
|
||||
print s
|
||||
assert s.find("test_show_path_before_running_test.py") != -1
|
||||
|
|
Loading…
Reference in New Issue