Commit 505cce24 authored by LE GAC Renaud's avatar LE GAC Renaud
Browse files

Update scripts/run to fix crashes running pytest behind a container.

parent 0edece57
......@@ -163,7 +163,7 @@ def get_web2py(args):
if out:
for line in out.split("\n"):
li = line.split()
if args.docker_container == li[-1]:
if li and args.docker_container == li[-1]:
cmd = [DOCKER,
"exec",
"-it",
......@@ -171,10 +171,10 @@ def get_web2py(args):
os.path.join(W2P_CNT, WEB2PY)]
return cmd
print "\n\tweb2py.py is not found !"
print "\tDirectory", args.web2py_dir, "don't exists !"
print "\tDocker container", args.docker_container, "don't exist !"
print "\tTune the option --web2py-dir or --docker-container.\n"
print "\n\tweb2py.py is not found on the local host!"
print "\tNo directory", args.web2py_dir, "on the local host!"
print "\tDocker container", args.docker_container, "is not running!"
print "\tStart container or tune option --web2py-dir, --docker-container.\n"
sys.exit(1)
......@@ -345,11 +345,12 @@ def run_pytest(args):
"""
cmd = ""
skip_options = ("docker_container", "func", "path", "shell", "web2py_dir")
# collect active option
for k, v in vars(args).iteritems():
if not v or k in ("func", "path", "shell"):
if (not v) or (k in skip_options):
continue
elif k == "capture":
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment