diff options
| author | Claude Paroz <claude@2xlibre.net> | 2012-04-28 18:02:01 +0200 |
|---|---|---|
| committer | Claude Paroz <claude@2xlibre.net> | 2012-04-30 20:45:03 +0200 |
| commit | 596cb9c7e287abbb98c64974fb4944d522cb6b5a (patch) | |
| tree | e8ad5402dd233458b392d1822146bb1102ba74a6 /tests | |
| parent | fe43ad5707d116bb1729bc17a24ca16c90ae040d (diff) | |
Replaced print statement by print function (forward compatibility syntax).
Diffstat (limited to 'tests')
6 files changed, 23 insertions, 23 deletions
diff --git a/tests/regressiontests/admin_scripts/management/commands/app_command.py b/tests/regressiontests/admin_scripts/management/commands/app_command.py index 6adab6eafd..d26df12642 100644 --- a/tests/regressiontests/admin_scripts/management/commands/app_command.py +++ b/tests/regressiontests/admin_scripts/management/commands/app_command.py @@ -7,5 +7,5 @@ class Command(AppCommand): args = '[appname ...]' def handle_app(self, app, **options): - print 'EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items())) + print('EXECUTE:AppCommand app=%s, options=%s' % (app, sorted(options.items()))) diff --git a/tests/regressiontests/admin_scripts/management/commands/base_command.py b/tests/regressiontests/admin_scripts/management/commands/base_command.py index 05fbcbc9c3..2701f32a05 100644 --- a/tests/regressiontests/admin_scripts/management/commands/base_command.py +++ b/tests/regressiontests/admin_scripts/management/commands/base_command.py @@ -14,4 +14,4 @@ class Command(BaseCommand): args = '[labels ...]' def handle(self, *labels, **options): - print 'EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items())) + print('EXECUTE:BaseCommand labels=%s, options=%s' % (labels, sorted(options.items()))) diff --git a/tests/regressiontests/admin_scripts/management/commands/label_command.py b/tests/regressiontests/admin_scripts/management/commands/label_command.py index 74cbd6991d..3bce1305bc 100644 --- a/tests/regressiontests/admin_scripts/management/commands/label_command.py +++ b/tests/regressiontests/admin_scripts/management/commands/label_command.py @@ -7,4 +7,4 @@ class Command(LabelCommand): args = '<label>' def handle_label(self, label, **options): - print 'EXECUTE:LabelCommand label=%s, options=%s' % (label, sorted(options.items())) + print('EXECUTE:LabelCommand label=%s, options=%s' % (label, sorted(options.items()))) diff --git a/tests/regressiontests/admin_scripts/management/commands/noargs_command.py b/tests/regressiontests/admin_scripts/management/commands/noargs_command.py index 0c272963b1..9652099f9b 100644 --- a/tests/regressiontests/admin_scripts/management/commands/noargs_command.py +++ b/tests/regressiontests/admin_scripts/management/commands/noargs_command.py @@ -7,4 +7,4 @@ class Command(NoArgsCommand): def handle_noargs(self, **options): - print 'EXECUTE:NoArgsCommand options=%s' % sorted(options.items()) + print('EXECUTE:NoArgsCommand options=%s' % sorted(options.items())) diff --git a/tests/regressiontests/test_runner/tests.py b/tests/regressiontests/test_runner/tests.py index 9f8085b5b6..27e18ce550 100644 --- a/tests/regressiontests/test_runner/tests.py +++ b/tests/regressiontests/test_runner/tests.py @@ -166,7 +166,7 @@ class CustomOptionsTestRunner(simple.DjangoTestSuiteRunner): self.option_c = option_c def run_tests(self, test_labels, extra_tests=None, **kwargs): - print "%s:%s:%s" % (self.option_a, self.option_b, self.option_c) + print("%s:%s:%s" % (self.option_a, self.option_b, self.option_c)) class CustomTestRunnerOptionsTests(AdminScriptTestCase): diff --git a/tests/runtests.py b/tests/runtests.py index 257aa3083d..5e5c7dcecc 100755 --- a/tests/runtests.py +++ b/tests/runtests.py @@ -126,7 +126,7 @@ def setup(verbosity, test_labels): # this module and add it to the list to test. if not test_labels or module_name in test_labels_set: if verbosity >= 2: - print "Importing application %s" % module_name + print("Importing application %s" % module_name) mod = load_app(module_label) if mod: if module_label not in settings.INSTALLED_APPS: @@ -178,7 +178,7 @@ def bisect_tests(bisection_label, options, test_labels): from django.db.models.loading import get_apps test_labels = [app.__name__.split('.')[-2] for app in get_apps()] - print '***** Bisecting test suite:',' '.join(test_labels) + print('***** Bisecting test suite: %s' % ' '.join(test_labels)) # Make sure the bisection point isn't in the test list # Also remove tests that need to be run in specific combinations @@ -202,44 +202,44 @@ def bisect_tests(bisection_label, options, test_labels): midpoint = len(test_labels)/2 test_labels_a = test_labels[:midpoint] + [bisection_label] test_labels_b = test_labels[midpoint:] + [bisection_label] - print '***** Pass %da: Running the first half of the test suite' % iteration - print '***** Test labels:',' '.join(test_labels_a) + print('***** Pass %da: Running the first half of the test suite' % iteration) + print('***** Test labels: %s' % ' '.join(test_labels_a)) failures_a = subprocess.call(subprocess_args + test_labels_a) - print '***** Pass %db: Running the second half of the test suite' % iteration - print '***** Test labels:',' '.join(test_labels_b) - print + print('***** Pass %db: Running the second half of the test suite' % iteration) + print('***** Test labels: %s' % ' '.join(test_labels_b)) + print('') failures_b = subprocess.call(subprocess_args + test_labels_b) if failures_a and not failures_b: - print "***** Problem found in first half. Bisecting again..." + print("***** Problem found in first half. Bisecting again...") iteration = iteration + 1 test_labels = test_labels_a[:-1] elif failures_b and not failures_a: - print "***** Problem found in second half. Bisecting again..." + print("***** Problem found in second half. Bisecting again...") iteration = iteration + 1 test_labels = test_labels_b[:-1] elif failures_a and failures_b: - print "***** Multiple sources of failure found" + print("***** Multiple sources of failure found") break else: - print "***** No source of failure found... try pair execution (--pair)" + print("***** No source of failure found... try pair execution (--pair)") break if len(test_labels) == 1: - print "***** Source of error:",test_labels[0] + print("***** Source of error: %s" % test_labels[0]) teardown(state) def paired_tests(paired_test, options, test_labels): state = setup(int(options.verbosity), test_labels) if not test_labels: - print "" + print("") # Get the full list of test labels to use for bisection from django.db.models.loading import get_apps test_labels = [app.__name__.split('.')[-2] for app in get_apps()] - print '***** Trying paired execution' + print('***** Trying paired execution') # Make sure the constant member of the pair isn't in the test list # Also remove tests that need to be run in specific combinations @@ -259,14 +259,14 @@ def paired_tests(paired_test, options, test_labels): subprocess_args.append('--noinput') for i, label in enumerate(test_labels): - print '***** %d of %d: Check test pairing with %s' % ( - i+1, len(test_labels), label) + print('***** %d of %d: Check test pairing with %s' % ( + i + 1, len(test_labels), label)) failures = subprocess.call(subprocess_args + [label, paired_test]) if failures: - print '***** Found problem pair with',label + print('***** Found problem pair with %s' % label) return - print '***** No problem pair found' + print('***** No problem pair found') teardown(state) if __name__ == "__main__": |
