[svn r58319] be more grateful on tests that disappear during a looponfailing session.
--HG-- branch : trunk
This commit is contained in:
parent
e4e1e9f26d
commit
e63da23050
|
@ -137,8 +137,14 @@ def slave_runsession(channel, config, width, hasmarkup):
|
||||||
session.reporter._tw.hasmarkup = hasmarkup
|
session.reporter._tw.hasmarkup = hasmarkup
|
||||||
session.reporter._tw.fullwidth = width
|
session.reporter._tw.fullwidth = width
|
||||||
if trails:
|
if trails:
|
||||||
colitems = [py.test.collect.Collector._fromtrail(x, config)
|
colitems = []
|
||||||
for x in trails]
|
for trail in trails:
|
||||||
|
try:
|
||||||
|
colitem = py.test.collect.Collector._fromtrail(trail, config)
|
||||||
|
except AssertionError, e:
|
||||||
|
#XXX session.bus.notify of "test disappeared"
|
||||||
|
continue
|
||||||
|
colitems.append(colitem)
|
||||||
else:
|
else:
|
||||||
colitems = None
|
colitems = None
|
||||||
session.shouldclose = channel.isclosed
|
session.shouldclose = channel.isclosed
|
||||||
|
|
|
@ -112,3 +112,30 @@ class TestLooponFailing(suptest.InlineCollection):
|
||||||
|
|
||||||
session.loop_once(loopstate)
|
session.loop_once(loopstate)
|
||||||
assert len(loopstate.colitems) == 1
|
assert len(loopstate.colitems) == 1
|
||||||
|
|
||||||
|
def test_looponfailing_removed_test(self):
|
||||||
|
modcol = self.getmodulecol("""
|
||||||
|
def test_one():
|
||||||
|
assert 0
|
||||||
|
def test_two():
|
||||||
|
assert 0
|
||||||
|
""")
|
||||||
|
session = LooponfailingSession(modcol._config)
|
||||||
|
loopstate = LoopState()
|
||||||
|
session.remotecontrol.setup()
|
||||||
|
loopstate.colitems = []
|
||||||
|
session.loop_once(loopstate)
|
||||||
|
assert len(loopstate.colitems) == 2
|
||||||
|
|
||||||
|
modcol.fspath.write(py.code.Source("""
|
||||||
|
def test_xxx(): # renamed test
|
||||||
|
assert 0
|
||||||
|
def test_two():
|
||||||
|
assert 1 # pass now
|
||||||
|
"""))
|
||||||
|
assert session.statrecorder.check()
|
||||||
|
session.loop_once(loopstate)
|
||||||
|
assert len(loopstate.colitems) == 0
|
||||||
|
|
||||||
|
session.loop_once(loopstate)
|
||||||
|
assert len(loopstate.colitems) == 1
|
||||||
|
|
Loading…
Reference in New Issue