[py-svn] r63028 - in py/trunk/py: doc execnet test/dsession test/plugin test/testing
hpk at codespeak.net
hpk at codespeak.net
Wed Mar 18 13:05:20 CET 2009
Author: hpk
Date: Wed Mar 18 13:05:18 2009
New Revision: 63028
Modified:
py/trunk/py/doc/execnet.txt
py/trunk/py/execnet/gwmanage.py
py/trunk/py/test/dsession/hostmanage.py
py/trunk/py/test/dsession/masterslave.py
py/trunk/py/test/plugin/pytest_pytester.py
py/trunk/py/test/plugin/pytest_terminal.py
py/trunk/py/test/testing/acceptance_test.py
Log:
allow py.test --exec=python2.4 -n 3 to work
and fix some bugs from doing so.
Modified: py/trunk/py/doc/execnet.txt
==============================================================================
--- py/trunk/py/doc/execnet.txt (original)
+++ py/trunk/py/doc/execnet.txt Wed Mar 18 13:05:18 2009
@@ -140,7 +140,7 @@
>>> gwspec = py.execnet.GatewaySpec("popen")
>>> gw = gwspec.makegateway()
>>> ex = gw.remote_exec("import sys ; channel.send(sys.executable)").receive()
- >>> assert ex == py.std.sys.executable
+ >>> assert ex == py.std.sys.executable, (ex, py.std.sys.executable)
>>>
current gateway types and specifications
Modified: py/trunk/py/execnet/gwmanage.py
==============================================================================
--- py/trunk/py/execnet/gwmanage.py (original)
+++ py/trunk/py/execnet/gwmanage.py Wed Mar 18 13:05:18 2009
@@ -24,7 +24,7 @@
NO_ENDMARKER_WANTED = object()
class GatewaySpec(object):
- python = "python"
+ python = None
def __init__(self, spec, defaultjoinpath="pyexecnetcache"):
if spec == "popen" or spec.startswith("popen:"):
parts = spec.split(":", 2)
@@ -35,6 +35,9 @@
self.joinpath = parts.pop(0)
else:
self.joinpath = ""
+ if not self.python:
+ self.python = py.std.sys.executable
+
elif spec.startswith("socket:"):
parts = spec[7:].split(":", 2)
self.address = parts.pop(0)
Modified: py/trunk/py/test/dsession/hostmanage.py
==============================================================================
--- py/trunk/py/test/dsession/hostmanage.py (original)
+++ py/trunk/py/test/dsession/hostmanage.py Wed Mar 18 13:05:18 2009
@@ -6,7 +6,11 @@
def getconfiggwspecs(config):
if config.option.numprocesses:
- gwspecs = ['popen'] * config.option.numprocesses
+ if config.option.executable:
+ s = 'popen:%s' % config.option.executable
+ else:
+ s = 'popen'
+ gwspecs = [s] * config.option.numprocesses
else:
gwspecs = config.option.gateways
if not gwspecs:
Modified: py/trunk/py/test/dsession/masterslave.py
==============================================================================
--- py/trunk/py/test/dsession/masterslave.py (original)
+++ py/trunk/py/test/dsession/masterslave.py Wed Mar 18 13:05:18 2009
@@ -120,11 +120,8 @@
self.sendevent("itemtestreport", testrep)
-def makehostup(host=None):
- from py.__.execnet.gwmanage import GatewaySpec
+def makehostup(host="INPROCESS"):
import sys
- if host is None:
- host = GatewaySpec("localhost")
platinfo = {}
for name in 'platform', 'executable', 'version_info':
platinfo["sys."+name] = getattr(sys, name)
Modified: py/trunk/py/test/plugin/pytest_pytester.py
==============================================================================
--- py/trunk/py/test/plugin/pytest_pytester.py (original)
+++ py/trunk/py/test/plugin/pytest_pytester.py Wed Mar 18 13:05:18 2009
@@ -232,7 +232,7 @@
else:
script = bindir.join(scriptname)
assert script.check()
- return self.run(script, *args)
+ return self.run(py.std.sys.executable, script, *args)
def runpytest(self, *args):
p = py.path.local.make_numbered_dir(prefix="runpytest-",
Modified: py/trunk/py/test/plugin/pytest_terminal.py
==============================================================================
--- py/trunk/py/test/plugin/pytest_terminal.py (original)
+++ py/trunk/py/test/plugin/pytest_terminal.py Wed Mar 18 13:05:18 2009
@@ -98,7 +98,7 @@
def pyevent_hostup(self, event):
d = event.platinfo.copy()
- d['host'] = event.host.address
+ d['host'] = getattr(event.host, 'address', event.host)
d['version'] = repr_pythonversion(d['sys.version_info'])
self.write_line("HOSTUP: %(host)s %(sys.platform)s "
"%(sys.executable)s - Python %(version)s" %
@@ -325,7 +325,7 @@
rep = TerminalReporter(item.config, linecomp.stringio)
rep.pyevent_hostup(makehostup())
linecomp.assert_contains_lines([
- "*localhost %s %s - Python %s" %(sys.platform,
+ "*inline %s %s - Python %s" %(sys.platform,
sys.executable, repr_pythonversion(sys.version_info))
])
Modified: py/trunk/py/test/testing/acceptance_test.py
==============================================================================
--- py/trunk/py/test/testing/acceptance_test.py (original)
+++ py/trunk/py/test/testing/acceptance_test.py Wed Mar 18 13:05:18 2009
@@ -179,7 +179,7 @@
verinfo = ".".join(map(str, py.std.sys.version_info[:3]))
extra = result.stdout.fnmatch_lines([
"*===== test session starts ====*",
- "*localhost* %s %s - Python %s*" %(
+ "HOSTUP*INPROCESS* %s %s - Python %s*" %(
py.std.sys.platform, py.std.sys.executable, verinfo),
"*test_header_trailer_info.py .",
"=* 1 passed in *.[0-9][0-9] seconds *=",
@@ -379,7 +379,7 @@
return spawn
def requirespexpect(self, version_needed):
- import pexpect
+ pexpect = py.test.importorskip("pexpect")
ver = tuple(map(int, pexpect.__version__.split(".")))
if ver < version_needed:
py.test.skip("pexpect version %s needed" %(".".join(map(str, version_needed))))
More information about the pytest-commit
mailing list