Skip to content

Commit e85c957

Browse files
committed
2to3.py runned for print & except
1 parent ec3c897 commit e85c957

File tree

4 files changed

+19
-19
lines changed

4 files changed

+19
-19
lines changed

test/resources/statuschecker.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ def _get_log_message(self, msg_str):
177177
import os
178178

179179
if not 2 <= len(sys.argv) <= 3 or '--help' in sys.argv:
180-
print __doc__
180+
print(__doc__)
181181
sys.exit(1)
182182
infile = sys.argv[1]
183183
outfile = sys.argv[2] if len(sys.argv) == 3 else None
184-
print "Checking %s" % os.path.abspath(infile)
184+
print("Checking %s" % os.path.abspath(infile))
185185
rc = process_output(infile, outfile)
186186
if outfile:
187-
print "Output: %s" % os.path.abspath(outfile)
187+
print("Output: %s" % os.path.abspath(outfile))
188188
if rc > 255:
189189
rc = 255
190190
sys.exit(rc)

test/resources/testserver/testserver.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def start_server(port=7000):
9494
if __name__ == '__main__':
9595
import sys
9696
if len(sys.argv) != 2 or sys.argv[1] not in [ 'start', 'stop' ]:
97-
print 'usage: %s start|stop' % sys.argv[0]
97+
print('usage: %s start|stop' % sys.argv[0])
9898
sys.exit(1)
9999
if sys.argv[1] == 'start':
100100
start_server()

test/run_tests.py

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -53,29 +53,29 @@ def execute_tests(runner, args):
5353
if not os.path.exists(env.RESULTS_DIR):
5454
os.mkdir(env.RESULTS_DIR)
5555
command = [runner] + [arg % ARG_VALUES for arg in ROBOT_ARGS] + args + [env.ACCEPTANCE_TEST_DIR]
56-
print ''
57-
print 'Starting test execution with command:\n' + ' '.join(command)
56+
print('')
57+
print('Starting test execution with command:\n' + ' '.join(command))
5858
syslog = os.path.join(env.RESULTS_DIR, 'syslog.txt')
5959
call(command, shell=os.sep=='\\', env=dict(os.environ, ROBOT_SYSLOG_FILE=syslog))
6060

6161
def stop_http_server():
6262
call(['python', env.HTTP_SERVER_FILE, 'stop'])
6363

6464
def process_output(args):
65-
print
65+
print()
6666
if _has_robot_27():
6767
call(['python', os.path.join(env.RESOURCES_DIR, 'statuschecker.py'),
6868
os.path.join(env.RESULTS_DIR, 'output.xml')])
6969
rebot = 'rebot' if os.sep == '/' else 'rebot.bat'
7070
rebot_cmd = [rebot] + [ arg % ARG_VALUES for arg in REBOT_ARGS ] + args + \
7171
[os.path.join(ARG_VALUES['outdir'], 'output.xml') ]
72-
print ''
73-
print 'Starting output processing with command:\n' + ' '.join(rebot_cmd)
72+
print('')
73+
print('Starting output processing with command:\n' + ' '.join(rebot_cmd))
7474
rc = call(rebot_cmd, env=os.environ)
7575
if rc == 0:
76-
print 'All critical tests passed'
76+
print('All critical tests passed')
7777
else:
78-
print '%d critical test%s failed' % (rc, 's' if rc != 1 else '')
78+
print('%d critical test%s failed' % (rc, 's' if rc != 1 else ''))
7979
return rc
8080

8181
def _has_robot_27():
@@ -89,18 +89,18 @@ def _exit(rc):
8989
sys.exit(rc)
9090

9191
def _help():
92-
print 'Usage: python run_tests.py python|jython browser [options]'
93-
print
94-
print 'See README.txt for details.'
92+
print('Usage: python run_tests.py python|jython browser [options]')
93+
print()
94+
print('See README.txt for details.')
9595
return 255
9696

9797
def _run_unit_tests():
98-
print 'Running unit tests'
98+
print('Running unit tests')
9999
failures = run_unit_tests()
100100
if failures != 0:
101-
print '\n%d unit tests failed - not running acceptance tests!' % failures
101+
print('\n%d unit tests failed - not running acceptance tests!' % failures)
102102
else:
103-
print 'All unit tests passed'
103+
print('All unit tests passed')
104104
return failures
105105

106106

test/run_unit_tests.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ def run_unit_tests(modules_to_run=[]):
1010
bad_modules_to_run = [module_to_run for module_to_run in modules_to_run
1111
if module_to_run not in test_module_names]
1212
if bad_modules_to_run:
13-
print "Specified test module%s not exist: %s" % (
13+
print("Specified test module%s not exist: %s" % (
1414
' does' if len(bad_modules_to_run) == 1 else 's do',
15-
', '.join(bad_modules_to_run))
15+
', '.join(bad_modules_to_run)))
1616
return -1
1717

1818
tests = [unittest.defaultTestLoader.loadTestsFromModule(test_module)

0 commit comments

Comments
 (0)