Changeset d083cc for tests/Python/AllActions/moltest.py
- Timestamp:
- Jan 24, 2024, 12:09:57 AM (21 months ago)
- Branches:
- Candidate_v1.7.0, stable
- Children:
- 5a479d
- Parents:
- 6dde30
- git-author:
- Frederik Heber <frederik.heber@…> (01/24/24 00:09:17)
- git-committer:
- Frederik Heber <frederik.heber@…> (01/24/24 00:09:57)
- File:
-
- 1 edited
-
tests/Python/AllActions/moltest.py (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
tests/Python/AllActions/moltest.py
r6dde30 rd083cc 27 27 key, value = line.split('\t', 1) 28 28 except ValueError: 29 print "line needs two values, tab-separated: "+line29 print("line needs two values, tab-separated: "+line) 30 30 sys.exit(1) 31 31 value = value[1:-2] # quotes entfernen … … 46 46 47 47 if not param in Defaults: 48 print 'Fehlender Defaultwert:', param48 print('Fehlender Defaultwert:', param) 49 49 50 50 # direkt substituieren, oder erst beim aufruf? … … 59 59 params = ParseParameters(doc) 60 60 61 print '--BEGIN-- %s mit %s --------' % (cmd, params)61 print('--BEGIN-- %s mit %s --------' % (cmd, params)) 62 62 63 63 # write command to file … … 66 66 output.close() 67 67 # call python externally on this file and catch retcode 68 p = subprocess.Popen(["python ", "test.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)68 p = subprocess.Popen(["python3", "test.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) 69 69 stdout, stderr = p.communicate() 70 print ' --- STDOUT ---'71 print ' %s ' % (stdout)72 print ' --- STDERR ---'73 print ' %s ' % (stderr)70 print(' --- STDOUT ---') 71 print(' %s ' % (stdout)) 72 print(' --- STDERR ---') 73 print(' %s ' % (stderr)) 74 74 retcode = p.returncode 75 75 if retcode == 134 or retcode == 0: 76 print ' ---- ok ----'76 print(' ---- ok ----') 77 77 else: 78 print ' -- FAILED with %s --' % (retcode)78 print(' -- FAILED with %s --' % (retcode)) 79 79 # if retcode == 1: 80 80 # sys.exit(1) 81 81 #exec('mol.%s(*params)' % cmd) 82 82 83 print '---END--- %s mit %s --------' % (cmd, params)83 print('---END--- %s mit %s --------' % (cmd, params)) 84 84 85 85 sys.exit(0)
Note:
See TracChangeset
for help on using the changeset viewer.
