summaryrefslogtreecommitdiff
path: root/Lib/test/test_pprint.py
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2001-08-17 18:39:25 +0000
committerMartin v. Löwis <martin@v.loewis.de>2001-08-17 18:39:25 +0000
commit339d0f720e86dc34837547c90d3003a4a68d7d46 (patch)
tree2059e5d02f490540e759800b127d50f3fcd8c2b5 /Lib/test/test_pprint.py
parentf75976617bb36c892ee8a0f6a6fd3caddbd38cea (diff)
downloadcpython-git-339d0f720e86dc34837547c90d3003a4a68d7d46.tar.gz
Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled - check for Py_USING_UNICODE in all places that use Unicode functions - disables unicode literals, and the builtin functions - add the types.StringTypes list - remove Unicode literals from most tests.
Diffstat (limited to 'Lib/test/test_pprint.py')
-rw-r--r--Lib/test/test_pprint.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/Lib/test/test_pprint.py b/Lib/test/test_pprint.py
index ba53ee8a7c..34c7a84f02 100644
--- a/Lib/test/test_pprint.py
+++ b/Lib/test/test_pprint.py
@@ -3,6 +3,11 @@ import unittest
import test_support
+try:
+ uni = unicode
+except NameError:
+ def uni(x):return x
+
class QueryTestCase(unittest.TestCase):
@@ -14,7 +19,7 @@ class QueryTestCase(unittest.TestCase):
def test_basic(self):
"""Verify .isrecursive() and .isreadable() w/o recursion."""
verify = self.assert_
- for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, u"yaddayadda",
+ for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, uni("yaddayadda"),
self.a, self.b):
verify(not pprint.isrecursive(safe),
"expected not isrecursive for " + `safe`)
@@ -58,8 +63,8 @@ class QueryTestCase(unittest.TestCase):
def test_same_as_repr(self):
"Simple objects and small containers that should be same as repr()."
verify = self.assert_
- for simple in (0, 0L, 0+0j, 0.0, "", u"", (), [], {}, verify, pprint,
- -6, -6L, -6-6j, -1.5, "x", u"x", (3,), [3], {3: 6},
+ for simple in (0, 0L, 0+0j, 0.0, "", uni(""), (), [], {}, verify, pprint,
+ -6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6},
(1,2), [3,4], {5: 6, 7: 8},
{"xy\tab\n": (3,), 5: [[]], (): {}},
range(10, -11, -1)