py3: use print_function in silenttestrunner.py
authorRobert Stanca <robert.stanca7@gmail.com>
Sat, 02 Apr 2016 18:17:23 +0300
changeset 28730 73437077753c
parent 28729 fc2268b9a07c
child 28731 f8872b507cd3
py3: use print_function in silenttestrunner.py
tests/silenttestrunner.py
tests/test-check-py3-compat.t
--- a/tests/silenttestrunner.py	Sat Apr 02 18:16:12 2016 +0300
+++ b/tests/silenttestrunner.py	Sat Apr 02 18:17:23 2016 +0300
@@ -1,4 +1,4 @@
-from __future__ import absolute_import
+from __future__ import absolute_import, print_function
 import unittest
 import sys
 import os
@@ -11,12 +11,12 @@
     suite.run(results)
     if results.errors or results.failures:
         for tc, exc in results.errors:
-            print 'ERROR:', tc
-            print
+            print('ERROR:', tc)
+            print()
             sys.stdout.write(exc)
         for tc, exc in results.failures:
-            print 'FAIL:', tc
-            print
+            print('FAIL:', tc)
+            print()
             sys.stdout.write(exc)
         sys.exit(1)
 
--- a/tests/test-check-py3-compat.t	Sat Apr 02 18:16:12 2016 +0300
+++ b/tests/test-check-py3-compat.t	Sat Apr 02 18:17:23 2016 +0300
@@ -49,7 +49,6 @@
   tests/readlink.py requires print_function
   tests/revlog-formatv0.py not using absolute_import
   tests/run-tests.py not using absolute_import
-  tests/silenttestrunner.py requires print_function
   tests/sitecustomize.py not using absolute_import
   tests/svn-safe-append.py not using absolute_import
   tests/svnxml.py not using absolute_import
@@ -254,7 +253,6 @@
   mercurial/windows.py: error importing module: <ImportError> No module named '_winreg' (line *) (glob)
   mercurial/wireproto.py: error importing module: <SyntaxError> invalid syntax (bundle*.py, line *) (line *) (glob)
   tests/readlink.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
-  tests/silenttestrunner.py: invalid syntax: Missing parentheses in call to 'print' (<unknown>, line *) (glob)
   tests/test-batching.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-bdiff.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)
   tests/test-context.py: invalid syntax: invalid syntax (<unknown>, line *) (glob)