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): ...@@ -163,7 +163,7 @@ def get_web2py(args):
if out: if out:
for line in out.split("\n"): for line in out.split("\n"):
li = line.split() li = line.split()
if args.docker_container == li[-1]: if li and args.docker_container == li[-1]:
cmd = [DOCKER, cmd = [DOCKER,
"exec", "exec",
"-it", "-it",
...@@ -171,10 +171,10 @@ def get_web2py(args): ...@@ -171,10 +171,10 @@ def get_web2py(args):
os.path.join(W2P_CNT, WEB2PY)] os.path.join(W2P_CNT, WEB2PY)]
return cmd return cmd
print "\n\ is not found !" print "\n\ is not found on the local host!"
print "\tDirectory", args.web2py_dir, "don't exists !" print "\tNo directory", args.web2py_dir, "on the local host!"
print "\tDocker container", args.docker_container, "don't exist !" print "\tDocker container", args.docker_container, "is not running!"
print "\tTune the option --web2py-dir or --docker-container.\n" print "\tStart container or tune option --web2py-dir, --docker-container.\n"
sys.exit(1) sys.exit(1)
...@@ -345,11 +345,12 @@ def run_pytest(args): ...@@ -345,11 +345,12 @@ def run_pytest(args):
""" """
cmd = "" cmd = ""
skip_options = ("docker_container", "func", "path", "shell", "web2py_dir")
# collect active option # collect active option
for k, v in vars(args).iteritems(): 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 continue
elif k == "capture": 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