Mercurial > cpython-lru_cache-weakref
annotate Lib/test/test_pprint.py @ 58765:2ba7677bfa95 legacy-trunk
testCopysign was defined twice in test_math; combine the definitions
| author | Mark Dickinson <dickinsm@gmail.com> |
|---|---|
| date | Sat, 06 Feb 2010 23:11:25 +0000 |
| parents | dab34b60a72e |
| children | b36cb4602e21 |
| rev | line source |
|---|---|
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
1 import pprint |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
2 import test.test_support |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
3 import unittest |
|
44927
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
4 import test.test_set |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
5 |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
6 try: |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
7 uni = unicode |
|
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
8 except NameError: |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
9 def uni(x): |
|
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
10 return x |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
11 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
12 # list, tuple and dict subclasses that do or don't overwrite __repr__ |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
13 class list2(list): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
14 pass |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
15 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
16 class list3(list): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
17 def __repr__(self): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
18 return list.__repr__(self) |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
19 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
20 class tuple2(tuple): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
21 pass |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
22 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
23 class tuple3(tuple): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
24 def __repr__(self): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
25 return tuple.__repr__(self) |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
26 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
27 class dict2(dict): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
28 pass |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
29 |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
30 class dict3(dict): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
31 def __repr__(self): |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
32 return dict.__repr__(self) |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
33 |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
34 class QueryTestCase(unittest.TestCase): |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
35 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
36 def setUp(self): |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
37 self.a = range(100) |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
38 self.b = range(200) |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
39 self.a[-12] = self.b |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
40 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
41 def test_basic(self): |
|
24957
dc66eb4cd17a
Standardize behavior: no docstrings in test functions.
Guido van Rossum <guido@python.org>
parents:
24364
diff
changeset
|
42 # Verify .isrecursive() and .isreadable() w/o recursion |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
43 pp = pprint.PrettyPrinter() |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
44 for safe in (2, 2.0, 2j, "abc", [3], (2,2), {3: 3}, uni("yaddayadda"), |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
45 self.a, self.b): |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
46 # module-level convenience functions |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
47 self.assertFalse(pprint.isrecursive(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
48 "expected not isrecursive for %r" % (safe,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
49 self.assertTrue(pprint.isreadable(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
50 "expected isreadable for %r" % (safe,)) |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
51 # PrettyPrinter methods |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
52 self.assertFalse(pp.isrecursive(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
53 "expected not isrecursive for %r" % (safe,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
54 self.assertTrue(pp.isreadable(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
55 "expected isreadable for %r" % (safe,)) |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
56 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
57 def test_knotted(self): |
|
24957
dc66eb4cd17a
Standardize behavior: no docstrings in test functions.
Guido van Rossum <guido@python.org>
parents:
24364
diff
changeset
|
58 # Verify .isrecursive() and .isreadable() w/ recursion |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
59 # Tie a knot. |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
60 self.b[67] = self.a |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
61 # Messy dict. |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
62 self.d = {} |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
63 self.d[0] = self.d[1] = self.d[2] = self.d |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
64 |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
65 pp = pprint.PrettyPrinter() |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
66 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
67 for icky in self.a, self.b, self.d, (self.d, self.d): |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
68 self.assertTrue(pprint.isrecursive(icky), "expected isrecursive") |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
69 self.assertFalse(pprint.isreadable(icky), "expected not isreadable") |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
70 self.assertTrue(pp.isrecursive(icky), "expected isrecursive") |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
71 self.assertFalse(pp.isreadable(icky), "expected not isreadable") |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
72 |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
73 # Break the cycles. |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
74 self.d.clear() |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
75 del self.a[:] |
|
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
76 del self.b[:] |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
77 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
78 for safe in self.a, self.b, self.d, (self.d, self.d): |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
79 # module-level convenience functions |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
80 self.assertFalse(pprint.isrecursive(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
81 "expected not isrecursive for %r" % (safe,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
82 self.assertTrue(pprint.isreadable(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
83 "expected isreadable for %r" % (safe,)) |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
84 # PrettyPrinter methods |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
85 self.assertFalse(pp.isrecursive(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
86 "expected not isrecursive for %r" % (safe,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
87 self.assertTrue(pp.isreadable(safe), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
88 "expected isreadable for %r" % (safe,)) |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
89 |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
90 def test_unreadable(self): |
|
24957
dc66eb4cd17a
Standardize behavior: no docstrings in test functions.
Guido van Rossum <guido@python.org>
parents:
24364
diff
changeset
|
91 # Not recursive but not readable anyway |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
92 pp = pprint.PrettyPrinter() |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
93 for unreadable in type(3), pprint, pprint.isrecursive: |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
94 # module-level convenience functions |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
95 self.assertFalse(pprint.isrecursive(unreadable), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
96 "expected not isrecursive for %r" % (unreadable,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
97 self.assertFalse(pprint.isreadable(unreadable), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
98 "expected not isreadable for %r" % (unreadable,)) |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
99 # PrettyPrinter methods |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
100 self.assertFalse(pp.isrecursive(unreadable), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
101 "expected not isrecursive for %r" % (unreadable,)) |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
102 self.assertFalse(pp.isreadable(unreadable), |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
103 "expected not isreadable for %r" % (unreadable,)) |
|
17820
4bcf88e4abff
SF bug[ #423781: pprint.isrecursive() broken.
Tim Peters <tim.peters@gmail.com>
parents:
diff
changeset
|
104 |
|
17828
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
105 def test_same_as_repr(self): |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
106 # Simple objects, small containers and classes that overwrite __repr__ |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
107 # For those the result should be the same as repr(). |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
108 # Ahem. The docs don't say anything about that -- this appears to |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
109 # be testing an implementation quirk. Starting in Python 2.5, it's |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
110 # not true for dicts: pprint always sorts dicts by key now; before, |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
111 # it sorted a dict display if and only if the display required |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
112 # multiple lines. For that reason, dicts with more than one element |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
113 # aren't tested here. |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
114 for simple in (0, 0L, 0+0j, 0.0, "", uni(""), |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
115 (), tuple2(), tuple3(), |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
116 [], list2(), list3(), |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
117 {}, dict2(), dict3(), |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
118 self.assertTrue, pprint, |
|
19343
7257e87e0720
Patch #445762: Support --disable-unicode
Martin v. Löwis <martin@v.loewis.de>
parents:
17829
diff
changeset
|
119 -6, -6L, -6-6j, -1.5, "x", uni("x"), (3,), [3], {3: 6}, |
|
52436
84e99efc67b2
don't rely on the order dict repr #5605
Benjamin Peterson <benjamin@python.org>
parents:
47797
diff
changeset
|
120 (1,2), [3,4], {5: 6}, |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
121 tuple2((1,2)), tuple3((1,2)), tuple3(range(100)), |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
122 [3,4], list2([3,4]), list3([3,4]), list3(range(100)), |
|
52436
84e99efc67b2
don't rely on the order dict repr #5605
Benjamin Peterson <benjamin@python.org>
parents:
47797
diff
changeset
|
123 dict2({5: 6}), dict3({5: 6}), |
|
17828
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
124 range(10, -11, -1) |
|
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
125 ): |
|
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
126 native = repr(simple) |
|
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
127 for function in "pformat", "saferepr": |
|
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
128 f = getattr(pprint, function) |
|
26745053f840
pprint's workhorse _safe_repr() function took time quadratic in the # of
Tim Peters <tim.peters@gmail.com>
parents:
17827
diff
changeset
|
129 got = f(simple) |
|
58474
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
130 self.assertEqual(native, got, |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
131 "expected %s got %s from pprint.%s" % |
|
dab34b60a72e
remove archaic functions from test_support
Ezio Melotti <ezio.melotti@gmail.com>
parents:
55002
diff
changeset
|
132 (native, got, function)) |
|
17827
0b3da99824c7
Convert the pprint test to use PyUnit.
Fred Drake <fdrake@acm.org>
parents:
17820
diff
changeset
|
133 |
|
21061
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
134 def test_basic_line_wrap(self): |
|
24957
dc66eb4cd17a
Standardize behavior: no docstrings in test functions.
Guido van Rossum <guido@python.org>
parents:
24364
diff
changeset
|
135 # verify basic line-wrapping operation |
|
21061
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
136 o = {'RPM_cal': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
137 'RPM_cal2': 48059, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
138 'Speed_cal': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
139 'controldesk_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
140 'main_code_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
141 'read_io_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
142 'write_io_runtime_us': 43690} |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
143 exp = """\ |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
144 {'RPM_cal': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
145 'RPM_cal2': 48059, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
146 'Speed_cal': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
147 'controldesk_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
148 'main_code_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
149 'read_io_runtime_us': 0, |
|
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
150 'write_io_runtime_us': 43690}""" |
|
31084
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
151 for type in [dict, dict2]: |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
152 self.assertEqual(pprint.pformat(type(o)), exp) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
153 |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
154 o = range(100) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
155 exp = '[%s]' % ',\n '.join(map(str, o)) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
156 for type in [list, list2]: |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
157 self.assertEqual(pprint.pformat(type(o)), exp) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
158 |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
159 o = tuple(range(100)) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
160 exp = '(%s)' % ',\n '.join(map(str, o)) |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
161 for type in [tuple, tuple2]: |
|
e3025fe70d8b
Patch #750542: pprint now will pretty print subclasses of list, tuple
Walter Dörwald <walter@livinglogic.de>
parents:
26930
diff
changeset
|
162 self.assertEqual(pprint.pformat(type(o)), exp) |
|
21061
1802a9edb4ee
__format(): Applied SF patch #482003 by Skip to fix multiline dict
Barry Warsaw <barry@python.org>
parents:
20013
diff
changeset
|
163 |
|
31085
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
164 # indent parameter |
|
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
165 o = range(100) |
|
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
166 exp = '[ %s]' % ',\n '.join(map(str, o)) |
|
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
167 for type in [list, list2]: |
|
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
168 self.assertEqual(pprint.pformat(type(o), indent=4), exp) |
|
a2f6c6a67f24
Add parameters indent, width and depth to pprint.pprint() and pprint.pformat()
Walter Dörwald <walter@livinglogic.de>
parents:
31084
diff
changeset
|
169 |
|
47797
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
170 def test_nested_indentations(self): |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
171 o1 = list(range(10)) |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
172 o2 = dict(first=1, second=2, third=3) |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
173 o = [o1, o2] |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
174 expected = """\ |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
175 [ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9], |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
176 { 'first': 1, |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
177 'second': 2, |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
178 'third': 3}]""" |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
179 self.assertEqual(pprint.pformat(o, indent=4, width=42), expected) |
|
016166b7b976
Fixed issue #2888. Now the behaviour of pprint when working with nested
Facundo Batista <facundobatista@gmail.com>
parents:
46947
diff
changeset
|
180 |
|
38546
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
181 def test_sorted_dict(self): |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
182 # Starting in Python 2.5, pprint sorts dict displays by key regardless |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
183 # of how small the dictionary may be. |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
184 # Before the change, on 32-bit Windows pformat() gave order |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
185 # 'a', 'c', 'b' here, so this test failed. |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
186 d = {'a': 1, 'b': 1, 'c': 1} |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
187 self.assertEqual(pprint.pformat(d), "{'a': 1, 'b': 1, 'c': 1}") |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
188 self.assertEqual(pprint.pformat([d, d]), |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
189 "[{'a': 1, 'b': 1, 'c': 1}, {'a': 1, 'b': 1, 'c': 1}]") |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
190 |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
191 # The next one is kind of goofy. The sorted order depends on the |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
192 # alphabetic order of type names: "int" < "str" < "tuple". Before |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
193 # Python 2.5, this was in the test_same_as_repr() test. It's worth |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
194 # keeping around for now because it's one of few tests of pprint |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
195 # against a crazy mix of types. |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
196 self.assertEqual(pprint.pformat({"xy\tab\n": (3,), 5: [[]], (): {}}), |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
197 r"{5: [[]], 'xy\tab\n': (3,), (): {}}") |
|
2eb8be0f8731
pprint functions used to sort a dict (by key) if and only if
Tim Peters <tim.peters@gmail.com>
parents:
31515
diff
changeset
|
198 |
|
22766
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
199 def test_subclassing(self): |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
200 o = {'names with spaces': 'should be presented using repr()', |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
201 'others.should.not.be': 'like.this'} |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
202 exp = """\ |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
203 {'names with spaces': 'should be presented using repr()', |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
204 others.should.not.be: like.this}""" |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
205 self.assertEqual(DottedPrettyPrinter().pformat(o), exp) |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
206 |
|
44927
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
207 def test_set_reprs(self): |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
208 self.assertEqual(pprint.pformat(set()), 'set()') |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
209 self.assertEqual(pprint.pformat(set(range(3))), 'set([0, 1, 2])') |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
210 self.assertEqual(pprint.pformat(frozenset()), 'frozenset()') |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
211 self.assertEqual(pprint.pformat(frozenset(range(3))), 'frozenset([0, 1, 2])') |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
212 cube_repr_tgt = """\ |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
213 {frozenset([]): frozenset([frozenset([2]), frozenset([0]), frozenset([1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
214 frozenset([0]): frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
215 frozenset([0, 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
216 frozenset([0, 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
217 frozenset([1]): frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
218 frozenset([1, 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
219 frozenset([0, 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
220 frozenset([2]): frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
221 frozenset([1, 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
222 frozenset([0, 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
223 frozenset([1, 2]): frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
224 frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
225 frozenset([0, 1, 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
226 frozenset([0, 2]): frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
227 frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
228 frozenset([0, 1, 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
229 frozenset([0, 1]): frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
230 frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
231 frozenset([0, 1, 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
232 frozenset([0, 1, 2]): frozenset([frozenset([1, 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
233 frozenset([0, 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
234 frozenset([0, 1])])}""" |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
235 cube = test.test_set.cube(3) |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
236 self.assertEqual(pprint.pformat(cube), cube_repr_tgt) |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
237 cubo_repr_tgt = """\ |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
238 {frozenset([frozenset([0, 2]), frozenset([0])]): frozenset([frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
239 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
240 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
241 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
242 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
243 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
244 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
245 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
246 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
247 frozenset([0])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
248 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
249 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
250 2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
251 frozenset([frozenset([0, 1]), frozenset([1])]): frozenset([frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
252 1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
253 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
254 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
255 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
256 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
257 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
258 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
259 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
260 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
261 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
262 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
263 frozenset([1])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
264 frozenset([frozenset([1, 2]), frozenset([1])]): frozenset([frozenset([frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
265 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
266 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
267 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
268 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
269 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
270 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
271 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
272 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
273 frozenset([1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
274 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
275 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
276 1])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
277 frozenset([frozenset([1, 2]), frozenset([2])]): frozenset([frozenset([frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
278 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
279 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
280 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
281 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
282 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
283 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
284 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
285 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
286 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
287 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
288 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
289 frozenset([2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
290 frozenset([frozenset([]), frozenset([0])]): frozenset([frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
291 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
292 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
293 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
294 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
295 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
296 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
297 frozenset([1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
298 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
299 frozenset([2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
300 frozenset([frozenset([]), frozenset([1])]): frozenset([frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
301 frozenset([0])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
302 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
303 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
304 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
305 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
306 frozenset([2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
307 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
308 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
309 1])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
310 frozenset([frozenset([2]), frozenset([])]): frozenset([frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
311 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
312 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
313 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
314 frozenset([0])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
315 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
316 frozenset([1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
317 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
318 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
319 2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
320 frozenset([frozenset([0, 1, 2]), frozenset([0, 1])]): frozenset([frozenset([frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
321 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
322 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
323 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
324 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
325 frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
326 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
327 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
328 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
329 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
330 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
331 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
332 1])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
333 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
334 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
335 1])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
336 frozenset([frozenset([0]), frozenset([0, 1])]): frozenset([frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
337 frozenset([0])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
338 frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
339 1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
340 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
341 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
342 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
343 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
344 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
345 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
346 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
347 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
348 1])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
349 frozenset([frozenset([2]), frozenset([0, 2])]): frozenset([frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
350 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
351 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
352 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
353 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
354 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
355 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
356 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
357 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
358 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
359 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
360 frozenset([frozenset(), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
361 frozenset([2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
362 frozenset([frozenset([0, 1, 2]), frozenset([0, 2])]): frozenset([frozenset([frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
363 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
364 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
365 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
366 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
367 frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
368 1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
369 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
370 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
371 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
372 frozenset([frozenset([0]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
373 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
374 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
375 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
376 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
377 2])])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
378 frozenset([frozenset([1, 2]), frozenset([0, 1, 2])]): frozenset([frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
379 2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
380 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
381 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
382 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
383 frozenset([frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
384 1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
385 frozenset([0, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
386 1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
387 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
388 frozenset([frozenset([2]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
389 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
390 2])]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
391 frozenset([frozenset([1]), |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
392 frozenset([1, |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
393 2])])])}""" |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
394 |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
395 cubo = test.test_set.linegraph(cube) |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
396 self.assertEqual(pprint.pformat(cubo), cubo_repr_tgt) |
|
757a7f31e460
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
Raymond Hettinger <python@rcn.com>
parents:
38546
diff
changeset
|
397 |
|
46947
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
398 def test_depth(self): |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
399 nested_tuple = (1, (2, (3, (4, (5, 6))))) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
400 nested_dict = {1: {2: {3: {4: {5: {6: 6}}}}}} |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
401 nested_list = [1, [2, [3, [4, [5, [6, []]]]]]] |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
402 self.assertEqual(pprint.pformat(nested_tuple), repr(nested_tuple)) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
403 self.assertEqual(pprint.pformat(nested_dict), repr(nested_dict)) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
404 self.assertEqual(pprint.pformat(nested_list), repr(nested_list)) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
405 |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
406 lv1_tuple = '(1, (...))' |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
407 lv1_dict = '{1: {...}}' |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
408 lv1_list = '[1, [...]]' |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
409 self.assertEqual(pprint.pformat(nested_tuple, depth=1), lv1_tuple) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
410 self.assertEqual(pprint.pformat(nested_dict, depth=1), lv1_dict) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
411 self.assertEqual(pprint.pformat(nested_list, depth=1), lv1_list) |
|
07a53bb82baa
#1713041: fix pprint's handling of maximum depth.
Georg Brandl <georg@python.org>
parents:
44927
diff
changeset
|
412 |
|
22766
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
413 |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
414 class DottedPrettyPrinter(pprint.PrettyPrinter): |
|
24957
dc66eb4cd17a
Standardize behavior: no docstrings in test functions.
Guido van Rossum <guido@python.org>
parents:
24364
diff
changeset
|
415 |
|
22766
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
416 def format(self, object, context, maxlevels, level): |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
417 if isinstance(object, str): |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
418 if ' ' in object: |
|
31515
71a294bd7950
Replace backticks with repr() or "%r"
Walter Dörwald <walter@livinglogic.de>
parents:
31085
diff
changeset
|
419 return repr(object), 1, 0 |
|
22766
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
420 else: |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
421 return object, 0, 0 |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
422 else: |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
423 return pprint.PrettyPrinter.format( |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
424 self, object, context, maxlevels, level) |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
425 |
|
d26d8575ac62
Add an experimental mechanism to support extending the pprint formatting.
Fred Drake <fdrake@acm.org>
parents:
21061
diff
changeset
|
426 |
|
20013
e3184e46303b
Change the PyUnit-based tests to use the test_main() approach. This
Fred Drake <fdrake@acm.org>
parents:
19343
diff
changeset
|
427 def test_main(): |
|
26930
32e4c7753416
Make sure PrettyPrinter methods that mirror the module-level
Fred Drake <fdrake@acm.org>
parents:
24957
diff
changeset
|
428 test.test_support.run_unittest(QueryTestCase) |
|
20013
e3184e46303b
Change the PyUnit-based tests to use the test_main() approach. This
Fred Drake <fdrake@acm.org>
parents:
19343
diff
changeset
|
429 |
|
e3184e46303b
Change the PyUnit-based tests to use the test_main() approach. This
Fred Drake <fdrake@acm.org>
parents:
19343
diff
changeset
|
430 |
|
e3184e46303b
Change the PyUnit-based tests to use the test_main() approach. This
Fred Drake <fdrake@acm.org>
parents:
19343
diff
changeset
|
431 if __name__ == "__main__": |
|
e3184e46303b
Change the PyUnit-based tests to use the test_main() approach. This
Fred Drake <fdrake@acm.org>
parents:
19343
diff
changeset
|
432 test_main() |
