diff options
Diffstat (limited to 'Lib/doctest.py')
| -rw-r--r-- | Lib/doctest.py | 34 | 
1 files changed, 17 insertions, 17 deletions
diff --git a/Lib/doctest.py b/Lib/doctest.py index d120a01306..f55396e21c 100644 --- a/Lib/doctest.py +++ b/Lib/doctest.py @@ -855,7 +855,7 @@ class DocTestFinder:          add them to `tests`.          """          if self._verbose: -            print 'Finding tests in %s' % name +            print('Finding tests in %s' % name)          # If we've already processed this object, then ignore it.          if id(obj) in seen: @@ -1384,28 +1384,28 @@ class DocTestRunner:                  failed.append(x)          if verbose:              if notests: -                print len(notests), "items had no tests:" +                print(len(notests), "items had no tests:")                  notests.sort()                  for thing in notests: -                    print "   ", thing +                    print("   ", thing)              if passed: -                print len(passed), "items passed all tests:" +                print(len(passed), "items passed all tests:")                  passed.sort()                  for thing, count in passed: -                    print " %3d tests in %s" % (count, thing) +                    print(" %3d tests in %s" % (count, thing))          if failed: -            print self.DIVIDER -            print len(failed), "items had failures:" +            print(self.DIVIDER) +            print(len(failed), "items had failures:")              failed.sort()              for thing, (f, t) in failed: -                print " %3d of %3d in %s" % (f, t, thing) +                print(" %3d of %3d in %s" % (f, t, thing))          if verbose: -            print totalt, "tests in", len(self._name2ft), "items." -            print totalt - totalf, "passed and", totalf, "failed." +            print(totalt, "tests in", len(self._name2ft), "items.") +            print(totalt - totalf, "passed and", totalf, "failed.")          if totalf: -            print "***Test Failed***", totalf, "failures." +            print("***Test Failed***", totalf, "failures.")          elif verbose: -            print "Test passed." +            print("Test passed.")          return totalf, totalt      #///////////////////////////////////////////////////////////////// @@ -1415,8 +1415,8 @@ class DocTestRunner:          d = self._name2ft          for name, (f, t) in other._name2ft.items():              if name in d: -                print "*** DocTestRunner.merge: '" + name + "' in both" \ -                    " testers; summing outcomes." +                print("*** DocTestRunner.merge: '" + name + "' in both" \ +                    " testers; summing outcomes.")                  f2, t2 = d[name]                  f = f + f2                  t = t + t2 @@ -1985,10 +1985,10 @@ class Tester:      def runstring(self, s, name):          test = DocTestParser().get_doctest(s, self.globs, name, None, None)          if self.verbose: -            print "Running string", name +            print("Running string", name)          (f,t) = self.testrunner.run(test)          if self.verbose: -            print f, "of", t, "examples failed in string", name +            print(f, "of", t, "examples failed in string", name)          return (f,t)      def rundoc(self, object, name=None, module=None): @@ -2512,7 +2512,7 @@ def debug_script(src, pm=False, globs=None):              try:                  execfile(srcfilename, globs, globs)              except: -                print sys.exc_info()[1] +                print(sys.exc_info()[1])                  pdb.post_mortem(sys.exc_info()[2])          else:              # Note that %r is vital here.  '%s' instead can, e.g., cause  | 
