[svn r63157] remove old events, some more renamings

--HG--
branch : trunk
This commit is contained in:
hpk 2009-03-20 21:38:50 +01:00
parent f157a5d697
commit 69e68bed29
5 changed files with 38 additions and 50 deletions

View File

@ -4,41 +4,6 @@ from py.__.test.dsession.masterslave import MasterNode
from py.__.execnet.gwmanage import GatewayManager
from py.__.test import event
def getxspecs(config):
if config.option.numprocesses:
if config.option.executable:
s = 'popen//python=%s' % config.option.executable
else:
s = 'popen'
xspecs = [s] * config.option.numprocesses
else:
xspecs = config.option.xspecs
if not xspecs:
xspecs = config.getvalue("xspecs")
assert xspecs is not None
#print "option value for xspecs", xspecs
return [py.execnet.XSpec(x) for x in xspecs]
def getconfigroots(config):
roots = config.option.rsyncdirs
if roots:
roots = [py.path.local(x) for x in roots.split(',')]
else:
roots = []
conftestroots = config.getconftest_pathlist("rsyncdirs")
if conftestroots:
roots.extend(conftestroots)
pydir = py.path.local(py.__file__).dirpath()
for root in roots:
if not root.check():
raise ValueError("rsyncdir doesn't exist: %r" %(root,))
if pydir is not None and root.basename == "py":
if root != pydir:
raise ValueError("root %r conflicts with current %r" %(root, pydir))
pydir = None
if pydir is not None:
roots.append(pydir)
return roots
class NodeManager(object):
def __init__(self, config, specs=None):
@ -94,7 +59,7 @@ class NodeManager(object):
self.gwmanager.rsync(self.config.topdir, **options)
# and cd into it
self.gwmanager.multi_chdir(self.config.topdir.basename, inplacelocal=False)
self.config.bus.notify("rsyncfinished", event.RsyncFinished())
self.config.bus.notify("rsyncfinished")
def trace(self, msg):
self.config.bus.notify("trace", "nodemanage", msg)
@ -123,3 +88,39 @@ class NodeManager(object):
def teardown_nodes(self):
# XXX teardown nodes?
self.gwmanager.exit()
def getxspecs(config):
if config.option.numprocesses:
if config.option.executable:
s = 'popen//python=%s' % config.option.executable
else:
s = 'popen'
xspecs = [s] * config.option.numprocesses
else:
xspecs = config.option.xspecs
if not xspecs:
xspecs = config.getvalue("xspecs")
assert xspecs is not None
#print "option value for xspecs", xspecs
return [py.execnet.XSpec(x) for x in xspecs]
def getconfigroots(config):
roots = config.option.rsyncdirs
if roots:
roots = [py.path.local(x) for x in roots.split(',')]
else:
roots = []
conftestroots = config.getconftest_pathlist("rsyncdirs")
if conftestroots:
roots.extend(conftestroots)
pydir = py.path.local(py.__file__).dirpath()
for root in roots:
if not root.check():
raise ValueError("rsyncdir doesn't exist: %r" %(root,))
if pydir is not None and root.basename == "py":
if root != pydir:
raise ValueError("root %r conflicts with current %r" %(root, pydir))
pydir = None
if pydir is not None:
roots.append(pydir)
return roots

View File

@ -89,6 +89,6 @@ class TestAsyncFunctional:
assert os.nice(0) == 10
""")
evrec = testdir.inline_run('-d', p1, '--tx=popen')
ev = evrec.getreport('test_nice')
ev = evrec.getfirstnamed('itemtestreport')
assert ev.passed

View File

@ -157,16 +157,11 @@ class HostRSyncing(BaseEvent):
self.remotepath = remotepath
self.synced = synced
class RsyncFinished(BaseEvent):
def __init__(self):
self.time = timestamp()
class HostRSyncRootReady(BaseEvent):
def __init__(self, host, root):
self.host = host
self.root = root
# make all eventclasses available on BaseEvent so that
# consumers of events can easily filter by
# 'isinstance(event, event.Name)' checks

View File

@ -258,11 +258,6 @@ class TerminalReporter:
else:
excrepr.reprcrash.toterminal(self._tw)
def out_hostinfo(self):
self._tw.line("host 0: %s %s - Python %s" %
(py.std.sys.platform,
py.std.sys.executable,
repr_pythonversion()))
class CollectonlyReporter:
INDENT = " "

View File

@ -240,7 +240,6 @@ class TestConfigApi_getcolitems:
class TestOptionEffects:
def test_boxed_option_default(self, testdir):
testdir.makepyfile(conftest="dist_hosts=[]")
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
config = py.test.config._reparse([tmpdir])
config.initsession()
@ -254,10 +253,8 @@ class TestOptionEffects:
assert not config.option.boxed
def test_boxed_option_from_conftest(self, testdir):
testdir.makepyfile(conftest="dist_hosts=[]")
tmpdir = testdir.tmpdir.ensure("subdir", dir=1)
tmpdir.join("conftest.py").write(py.code.Source("""
dist_hosts = []
dist_boxed = True
"""))
config = py.test.config._reparse(['--dist', tmpdir])