[svn r63786] rename CollectionReport to CollectReport, remove XXX.

--HG--
branch : trunk
This commit is contained in:
hpk 2009-04-07 13:51:55 +02:00
parent a37c32783d
commit 10e267b7b6
11 changed files with 27 additions and 32 deletions

View File

@ -30,7 +30,7 @@ class LoopState(object):
if rep.failed:
self.testsfailed = True
def pyevent__collectionreport(self, rep):
def pyevent__collectreport(self, rep):
if rep.passed:
self.colitems.extend(rep.result)
@ -175,7 +175,7 @@ class DSession(Session):
senditems.append(next)
else:
self.bus.notify("collectionstart", next)
self.queueevent("collectionreport", basic_collect_report(next))
self.queueevent("collectreport", basic_collect_report(next))
if self.config.option.dist == "each":
self.senditems_each(senditems)
else:

View File

@ -80,7 +80,7 @@ class TestDSession:
session = DSession(modcol.config)
session.triggertesting([modcol])
name, args, kwargs = session.queue.get(block=False)
assert name == 'collectionreport'
assert name == 'collectreport'
rep, = args
assert len(rep.result) == 1
@ -343,7 +343,7 @@ class TestDSession:
session.queueevent("itemtestreport", run(item1, node))
# but we have a collection pending
session.queueevent("collectionreport", colreport)
session.queueevent("collectreport", colreport)
loopstate = session._initloopstate([])
session.loop_once(loopstate)

View File

@ -140,7 +140,7 @@ def slave_runsession(channel, config, fullwidth, hasmarkup):
def pyevent__itemtestreport(self, rep):
if rep.failed:
self.append(rep)
pyevent__collectionreport = pyevent__itemtestreport
pyevent__collectreport = pyevent__itemtestreport
failreports = Failures()
session.bus.register(failreports)

View File

@ -100,7 +100,7 @@ class Events:
def pyevent__collectionstart(self, collector):
""" collector starts collecting. """
def pyevent__collectionreport(self, rep):
def pyevent__collectreport(self, rep):
""" collector finished collecting. """
def pyevent__testrunstart(self):

View File

@ -327,14 +327,14 @@ class EventRecorder(object):
# functionality for test reports
def getreports(self, names="itemtestreport collectionreport"):
def getreports(self, names="itemtestreport collectreport"):
names = names.split()
l = []
for call in self.getcalls(*names):
l.append(call.rep)
return l
def matchreport(self, inamepart="", names="itemtestreport collectionreport"):
def matchreport(self, inamepart="", names="itemtestreport collectreport"):
""" return a testreport whose dotted import path matches """
l = []
for rep in self.getreports(names=names):
@ -348,7 +348,7 @@ class EventRecorder(object):
inamepart, l))
return l[0]
def getfailures(self, names='itemtestreport collectionreport'):
def getfailures(self, names='itemtestreport collectreport'):
l = []
for call in self.getcalls(*names.split()):
if call.rep.failed:
@ -356,7 +356,7 @@ class EventRecorder(object):
return l
def getfailedcollections(self):
return self.getfailures('collectionreport')
return self.getfailures('collectreport')
def listoutcomes(self):
passed = []
@ -406,7 +406,7 @@ def test_eventrecorder():
rep.skipped = True
bus.notify("itemtestreport", rep)
rep = runner.CollectionReport(None, None)
rep = runner.CollectReport(None, None)
rep.passed = False
rep.failed = True
bus.notify("itemtestreport", rep)

View File

@ -68,7 +68,7 @@ class ResultLog(object):
longrepr = str(rep.longrepr.reprcrash.message)
self.log_outcome(rep, code, longrepr)
def pyevent__collectionreport(self, rep):
def pyevent__collectreport(self, rep):
if not rep.passed:
if rep.failed:
code = "F"

View File

@ -184,7 +184,7 @@ class TerminalReporter:
self._tw.write(" " + line)
self.currentfspath = -2
def pyevent__collectionreport(self, rep):
def pyevent__collectreport(self, rep):
if not rep.passed:
if rep.failed:
self.stats.setdefault("failed", []).append(rep)
@ -316,7 +316,7 @@ class CollectonlyReporter:
def pyevent__itemstart(self, item, node=None):
self.outindent(item)
def pyevent__collectionreport(self, rep):
def pyevent__collectreport(self, rep):
if not rep.passed:
self.outindent("!!! %s !!!" % rep.longrepr.reprcrash.message)
self._failed.append(rep)
@ -603,7 +603,7 @@ class TestTerminal:
lineno = 3
message = "justso"
ev1 = runner.CollectionReport(None, None)
ev1 = runner.CollectReport(None, None)
ev1.when = "execute"
ev1.skipped = True
ev1.longrepr = longrepr
@ -637,8 +637,8 @@ class TestCollectonly:
linecomp.assert_contains_lines([
" <Function 'test_func'>",
])
rep.config.bus.notify( "collectionreport",
runner.CollectionReport(modcol, [], excinfo=None))
rep.config.bus.notify( "collectreport",
runner.CollectReport(modcol, [], excinfo=None))
assert rep.indent == indent
def test_collectonly_skipped_module(self, testdir, linecomp):

View File

@ -52,7 +52,7 @@ def basic_collect_report(collector):
raise
except:
excinfo = py.code.ExceptionInfo()
return CollectionReport(collector, res, excinfo, outerr)
return CollectReport(collector, res, excinfo, outerr)
from cPickle import Pickler, Unpickler
@ -98,9 +98,7 @@ class BaseReport(object):
else:
out.line(str(longrepr))
# XXX rename to runtest() report ?
class ItemTestReport(BaseReport):
""" Test Execution Report. """
failed = passed = skipped = False
def __init__(self, colitem, excinfo=None, when=None, outerr=None):
@ -139,9 +137,7 @@ class ItemTestReport(BaseReport):
self.longrepr = longrepr
# XXX rename to collectreport
class CollectionReport(BaseReport):
""" Collection Report. """
class CollectReport(BaseReport):
skipped = failed = passed = False
def __init__(self, colitem, result, excinfo=None, outerr=None):
@ -160,7 +156,6 @@ class CollectionReport(BaseReport):
self.failed = True
class ItemSetupReport(BaseReport):
""" Test Execution Report. """
failed = passed = skipped = False
def __init__(self, item, excinfo=None, outerr=None):
self.item = item

View File

@ -47,7 +47,7 @@ class Session(object):
if rep.passed:
for x in self.genitems(rep.result, keywordexpr):
yield x
notify("collectionreport", rep)
notify("collectreport", rep)
if self.shouldstop:
break
@ -86,7 +86,7 @@ class Session(object):
self._testsfailed = True
if self.config.option.exitfirst:
self.shouldstop = True
pyevent__collectionreport = pyevent__itemtestreport
pyevent__collectreport = pyevent__itemtestreport
def sessionfinishes(self, exitstatus=0, excinfo=None):
""" teardown any resources after a test run. """

View File

@ -167,7 +167,7 @@ class TestCollectPluginHooks:
assert "hello" in wascalled
assert "world" in wascalled
# make sure the directories do not get double-appended
colreports = sorter.getreports(names="collectionreport")
colreports = sorter.getreports(names="collectreport")
names = [rep.colitem.name for rep in colreports]
assert names.count("hello") == 1
@ -207,10 +207,10 @@ class TestCustomConftests:
""")
testdir.mkdir("hello")
sorter = testdir.inline_run(testdir.tmpdir)
names = [rep.colitem.name for rep in sorter.getreports("collectionreport")]
names = [rep.colitem.name for rep in sorter.getreports("collectreport")]
assert 'hello' not in names
evrec = testdir.inline_run(testdir.tmpdir, "--XX")
names = [rep.colitem.name for rep in evrec.getreports("collectionreport")]
names = [rep.colitem.name for rep in evrec.getreports("collectreport")]
assert 'hello' in names
class TestCollectorReprs:

View File

@ -130,7 +130,7 @@ class SessionTests:
def test_one(): pass
""")
sorter = testdir.inline_run(testdir.tmpdir)
reports = sorter.getreports("collectionreport")
reports = sorter.getreports("collectreport")
assert len(reports) == 1
assert reports[0].skipped
@ -203,7 +203,7 @@ class TestNewSession(SessionTests):
assert len(itemstarted) == 3
assert not sorter.getreports("itemtestreport")
started = sorter.getcalls("collectionstart")
finished = sorter.getreports("collectionreport")
finished = sorter.getreports("collectreport")
assert len(started) == len(finished)
assert len(started) == 8
colfail = [x for x in finished if x.failed]
@ -215,7 +215,7 @@ class TestNewSession(SessionTests):
testdir.makepyfile(__init__="")
testdir.makepyfile(test_one="xxxx", test_two="yyyy")
sorter = testdir.inline_run("-x", testdir.tmpdir)
finished = sorter.getreports("collectionreport")
finished = sorter.getreports("collectreport")
colfail = [x for x in finished if x.failed]
assert len(colfail) == 1