Skip to content

Commit c0d5022

Browse files
committed
new test format py2/3
1 parent e6a4910 commit c0d5022

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed
File renamed without changes.

sbml_test_suite/run_all_tests.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,21 +18,21 @@
1818
os.makedirs(outDir)
1919

2020
tests = os.listdir(testDir)
21-
print tests
21+
print(tests)
2222

2323
for T in tests:
2424
retcode = subprocess.call([os.sys.executable, 'run_single_fbc_test.py', testDir, T, outDir])
2525

2626
testResults = []
2727
for T in tests:
28-
rF = file(os.path.join(testDir, T, '%s-results.csv' % T), 'r')
28+
rF = open(os.path.join(testDir, T, '%s-results.csv' % T), 'r')
2929
r0 = rF.read().strip()
3030
r0 = [a.split(',') for a in r0.split('\n')]
3131
r00 = {}
3232
for j_ in range(len(r0[0])):
3333
r00[r0[0][j_]] = r0[1][j_]
3434
rF.close()
35-
rF2 = file(os.path.join(outDir, '%s.csv' % T), 'r')
35+
rF2 = open(os.path.join(outDir, '%s.csv' % T), 'r')
3636
r1 = rF2.read().strip()
3737
r1 = [a.split(',') for a in r1.split('\n')]
3838
r11 = {}
@@ -46,6 +46,6 @@
4646
testRes = 'pass'
4747
testResults.append((T, testRes))
4848

49-
print '\n\nFBC Test Suite Results:\n===================='
49+
print('\n\nFBC Test Suite Results:\n====================')
5050
for t_ in testResults:
51-
print 'Test %s: %s' % (t_[0], t_[1])
51+
print('Test %s: %s' % (t_[0], t_[1]))

sbml_test_suite/run_single_fbc_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
cDir = os.path.dirname(os.path.abspath(os.sys.argv[0]))
33
import cbmpy as cbm
44

5-
print os.sys.argv
5+
print(os.sys.argv)
66

77
mBase = os.sys.argv[2]
88
testDir = os.path.join(os.sys.argv[1], mBase)
@@ -16,7 +16,7 @@
1616
## cbm.CBSolver.glpk_analyzeModel(cmod)
1717
cbm.CBSolver.analyzeModel(cmod)
1818

19-
F = file(os.path.join(testDir, '%s-settings.txt' % mBase), 'r')
19+
F = open(os.path.join(testDir, '%s-settings.txt' % mBase), 'r')
2020
variables = None
2121
for l_ in F:
2222
if l_.startswith('variables:'):
@@ -32,7 +32,7 @@
3232
data.append(cmod.getReaction(v_).getValue())
3333
#print data
3434

35-
F = file(os.path.join(outDir, mBase)+'.csv', 'w')
35+
F = open(os.path.join(outDir, mBase)+'.csv', 'w')
3636
out = ''
3737
for v_ in variables:
3838
out += '%s,' % v_

0 commit comments

Comments
 (0)