-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
executable file
·40 lines (26 loc) · 867 Bytes
/
run.py
File metadata and controls
executable file
·40 lines (26 loc) · 867 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#!/usr/bin/env python
import subprocess
from config import cfg
from shared.args import parse_args
def copy_script(args):
"""
copy_script(Namespace) -> None
We don't want to stuff around with importing the script, as that requires
a proper set of modules in the directory structure (ie, __init__.py).
So we copy the script to a known location to play with.
"""
cmd = 'cp %s %s.py'%(args.path, cfg.TEST_SCRIPT_PATH)
child = subprocess.Popen(cmd, shell=True)
child.wait()
if child.returncode:
exit(child.returncode)
def main():
args = parse_args()
copy_script(args)
# Call our test script from here
cmd = 'python ./test.py%s %s'%(' --masters' if args.masters else '',
args.path)
child = subprocess.Popen(cmd, shell=True)
child.wait()
if __name__ == '__main__':
main()