diff options
author | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
---|---|---|
committer | Walter Dörwald <walter@livinglogic.de> | 2004-02-12 17:35:32 (GMT) |
commit | 70a6b49821a3226f55e9716f32d802d06640cb89 (patch) | |
tree | 3c8ca10c1fa09e025bd266cf855a00d7d96c55aa /Lib/test/test_pprint.py | |
parent | ecfeb7f095dfd9c1c8929bf3df858ee35e0d9e9e (diff) | |
download | cpython-70a6b49821a3226f55e9716f32d802d06640cb89.zip cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.gz cpython-70a6b49821a3226f55e9716f32d802d06640cb89.tar.bz2 |
Replace backticks with repr() or "%r"
From SF patch #852334.
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r-- | Lib/test/test_pprint.py | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py index a61bb66..27d6b52 100644 --- a/Lib/test/test_pprint.py +++ b/Lib/test/test_pprint.py @@ -40,14 +40,14 @@ class QueryTestCase(unittest.TestCase): self.a, self.b): # module-level convenience functions verify(not pprint.isrecursive(safe), - "expected not isrecursive for " + `safe`) + "expected not isrecursive for %r" % (safe,)) verify(pprint.isreadable(safe), - "expected isreadable for " + `safe`) + "expected isreadable for %r" % (safe,)) # PrettyPrinter methods verify(not pp.isrecursive(safe), - "expected not isrecursive for " + `safe`) + "expected not isrecursive for %r" % (safe,)) verify(pp.isreadable(safe), - "expected isreadable for " + `safe`) + "expected isreadable for %r" % (safe,)) def test_knotted(self): # Verify .isrecursive() and .isreadable() w/ recursion @@ -74,14 +74,14 @@ class QueryTestCase(unittest.TestCase): for safe in self.a, self.b, self.d, (self.d, self.d): # module-level convenience functions verify(not pprint.isrecursive(safe), - "expected not isrecursive for " + `safe`) + "expected not isrecursive for %r" % (safe,)) verify(pprint.isreadable(safe), - "expected isreadable for " + `safe`) + "expected isreadable for %r" % (safe,)) # PrettyPrinter methods verify(not pp.isrecursive(safe), - "expected not isrecursive for " + `safe`) + "expected not isrecursive for %r" % (safe,)) verify(pp.isreadable(safe), - "expected isreadable for " + `safe`) + "expected isreadable for %r" % (safe,)) def test_unreadable(self): # Not recursive but not readable anyway @@ -90,14 +90,14 @@ class QueryTestCase(unittest.TestCase): for unreadable in type(3), pprint, pprint.isrecursive: # module-level convenience functions verify(not pprint.isrecursive(unreadable), - "expected not isrecursive for " + `unreadable`) + "expected not isrecursive for %r" % (unreadable,)) verify(not pprint.isreadable(unreadable), - "expected not isreadable for " + `unreadable`) + "expected not isreadable for %r" % (unreadable,)) # PrettyPrinter methods verify(not pp.isrecursive(unreadable), - "expected not isrecursive for " + `unreadable`) + "expected not isrecursive for %r" % (unreadable,)) verify(not pp.isreadable(unreadable), - "expected not isreadable for " + `unreadable`) + "expected not isreadable for %r" % (unreadable,)) def test_same_as_repr(self): # Simple objects, small containers and classes that overwrite __repr__ @@ -174,7 +174,7 @@ class DottedPrettyPrinter(pprint.PrettyPrinter): def format(self, object, context, maxlevels, level): if isinstance(object, str): if ' ' in object: - return `object`, 1, 0 + return repr(object), 1, 0 else: return object, 0, 0 else: |