[svn r57540] merge changes from release branch back
[svn merge -r 57430:HEAD ../release/0.9.x/ .] * cmdline script organisation * execnet windows fixes * documentation updates * test skips also regen setup.py --HG-- branch : trunk
This commit is contained in:
1
py/cmdline/testing/__init__.py
Normal file
1
py/cmdline/testing/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
#
|
||||
55
py/cmdline/testing/test_generic.py
Normal file
55
py/cmdline/testing/test_generic.py
Normal file
@@ -0,0 +1,55 @@
|
||||
import py
|
||||
import sys
|
||||
|
||||
binpath = py.path.local(py.__file__).dirpath("bin")
|
||||
binwinpath = binpath.join("win32")
|
||||
|
||||
def setup_module(mod):
|
||||
mod.tmpdir = py.test.ensuretemp(__name__)
|
||||
mod.iswin32 = sys.platform == "win32"
|
||||
|
||||
def checkmain(name):
|
||||
main = getattr(py.cmdline, name)
|
||||
assert callable(main)
|
||||
assert name[:2] == "py"
|
||||
scriptname = "py." + name[2:]
|
||||
assert binpath.join(scriptname).check()
|
||||
assert binwinpath.join(scriptname + ".cmd").check()
|
||||
|
||||
def checkprocess(script):
|
||||
assert script.check()
|
||||
old = tmpdir.ensure(script.basename, dir=1).chdir()
|
||||
try:
|
||||
if iswin32:
|
||||
cmd = script.basename
|
||||
else:
|
||||
cmd = "%s" %(script, )
|
||||
|
||||
if script.basename.startswith("py.lookup"):
|
||||
cmd += " hello"
|
||||
print "executing", script
|
||||
try:
|
||||
py.process.cmdexec(cmd)
|
||||
except py.process.cmdexec.Error, e:
|
||||
if cmd.find("py.rest") != -1 and \
|
||||
e.out.find("module named") != -1:
|
||||
return
|
||||
raise
|
||||
|
||||
finally:
|
||||
old.chdir()
|
||||
|
||||
def test_cmdline_namespace():
|
||||
for name in dir(py.cmdline):
|
||||
if name[0] != "_":
|
||||
yield checkmain, name
|
||||
|
||||
def test_script_invocation():
|
||||
if iswin32:
|
||||
for script in binwinpath.listdir("py.*"):
|
||||
assert script.ext == ".cmd"
|
||||
yield checkprocess, script
|
||||
else:
|
||||
for script in binpath.listdir("py.*"):
|
||||
yield checkprocess, script
|
||||
|
||||
Reference in New Issue
Block a user