comparison fail.py @ 6:6496dae95f0d default tip

add a few more variables to track; we will want to output them
author Jeff Hammel <k0scist@gmail.com>
date Wed, 24 Aug 2016 17:05:10 -0700
parents b407681e6f2c
children
comparison
equal deleted inserted replaced
5:b407681e6f2c 6:6496dae95f0d
37 program_start_time = time.time() if ctr else start_loop 37 program_start_time = time.time() if ctr else start_loop
38 38
39 # run the subcommand 39 # run the subcommand
40 process = subprocess.Popen(options.command, shell=True) 40 process = subprocess.Popen(options.command, shell=True)
41 stdout, stderr = process.communicate() 41 stdout, stderr = process.communicate()
42
43 # update variables
42 ctr += 1 44 ctr += 1
45 now = time.time()
46 duration = now - program_start_time
47 elapsed = now - start_loop
43 48
44 # print iteration information 49 # print iteration information
45 print ("Iteration {}".format(ctr)) 50 print ("Iteration {ctr}".format(ctr=ctr))
46 51
47 # test it 52 # test it
48 if process.returncode not in options.codes: 53 if process.returncode not in options.codes:
49 sys.exit(process.returncode) 54 sys.exit(process.returncode)
50 55