[svn r63910] removing old mentionings of "bus". docstrings.

--HG--
branch : trunk
This commit is contained in:
hpk 2009-04-09 20:07:05 +02:00
parent fb7ff9a8c2
commit f319a84503
6 changed files with 18 additions and 15 deletions

View File

@ -22,7 +22,9 @@ class Error(Exception):
""" Test Configuration Error. """
class Config(object):
""" central bus for dealing with configuration/initialization data. """
""" test configuration object, provides access to config valueso,
the pluginmanager and plugin api.
"""
Option = py.compat.optparse.Option # deprecated
Error = Error
basetemp = None

View File

@ -3,11 +3,11 @@ import py
from py.__.test.dist.txnode import TXNode
class EventQueue:
def __init__(self, bus, queue=None):
def __init__(self, registry, queue=None):
if queue is None:
queue = py.std.Queue.Queue()
self.queue = queue
bus.register(self)
registry.register(self)
def geteventargs(self, eventname, timeout=2.0):
events = []

View File

@ -45,6 +45,7 @@ class CallRecorder:
recorder = RecordCalls()
self._recorders[apiclass] = recorder
self._comregistry.register(recorder)
self.api = py._com.PluginAPI(apiclass, registry=self._comregistry)
def finalize(self):
for recorder in self._recorders.values():

View File

@ -73,10 +73,11 @@ class TmpTestdir:
if hasattr(self, '_olddir'):
self._olddir.chdir()
def geteventrecorder(self, bus):
sorter = EventRecorder(bus)
sorter.callrecorder = CallRecorder(bus)
def geteventrecorder(self, registry):
sorter = EventRecorder(registry)
sorter.callrecorder = CallRecorder(registry)
sorter.callrecorder.start_recording(api.PluginHooks)
sorter.api = sorter.callrecorder.api
self.pyfuncitem.addfinalizer(sorter.callrecorder.finalize)
return sorter
@ -361,13 +362,13 @@ class EventRecorder(object):
self.callrecorder.finalize()
def test_eventrecorder(testdir):
bus = py._com.Registry()
recorder = testdir.geteventrecorder(bus)
registry = py._com.Registry()
recorder = testdir.geteventrecorder(registry)
assert not recorder.getfailures()
rep = runner.ItemTestReport(None, None)
rep.passed = False
rep.failed = True
bus.call_each("pytest_itemtestreport", rep=rep)
recorder.api.pytest_itemtestreport(rep=rep)
failures = recorder.getfailures()
assert failures == [rep]
failures = recorder.getfailures()
@ -376,12 +377,12 @@ def test_eventrecorder(testdir):
rep = runner.ItemTestReport(None, None)
rep.passed = False
rep.skipped = True
bus.call_each("pytest_itemtestreport", rep=rep)
recorder.api.pytest_itemtestreport(rep=rep)
rep = runner.CollectReport(None, None)
rep.passed = False
rep.failed = True
bus.call_each("pytest_itemtestreport", rep=rep)
recorder.api.pytest_itemtestreport(rep=rep)
passed, skipped, failed = recorder.listoutcomes()
assert not passed and skipped and failed
@ -394,7 +395,7 @@ def test_eventrecorder(testdir):
recorder.unregister()
recorder.clear()
assert not recorder.getfailures()
bus.call_each("pytest_itemtestreport", rep=rep)
recorder.api.pytest_itemtestreport(rep=rep)
assert not recorder.getfailures()
class LineComp:

View File

@ -509,7 +509,7 @@ class TestTerminal:
])
def test_tb_option(self, testdir, linecomp):
# XXX usage of testdir and event bus
# XXX usage of testdir
for tbopt in ["long", "short", "no"]:
print 'testing --tb=%s...' % tbopt
modcol = testdir.getmodulecol("""
@ -569,7 +569,6 @@ class TestTerminal:
#""", configargs=("--showskipsummary",) + ("-v",)*verbose)
rep = TerminalReporter(modcol.config, file=linecomp.stringio)
modcol.config.pluginmanager.register(rep)
bus = modcol.config.pluginmanager
modcol.config.api.pytest_testrunstart()
try:
for item in testdir.genitems([modcol]):

View File

@ -317,7 +317,7 @@ def test_options_on_small_file_do_not_blow_up(testdir):
['--traceconfig'], ['-v'], ['-v', '-v']):
runfiletest(opts + [path])
def test_default_bus():
def test_default_registry():
assert py.test.config.pluginmanager.comregistry is py._com.comregistry
@py.test.mark.todo("test for deprecation")