Show More
@@ -68,11 +68,6 b' class BreakingRepr(object):' | |||
|
68 | 68 | def __repr__(self): |
|
69 | 69 | return "Breaking(\n)" |
|
70 | 70 | |
|
71 | class BreakingReprParent(object): | |
|
72 | def _repr_pretty_(self, p, cycle): | |
|
73 | with p.group(4,"TG: ",":"): | |
|
74 | p.pretty(BreakingRepr()) | |
|
75 | ||
|
76 | 71 | class BadRepr(object): |
|
77 | 72 | |
|
78 | 73 | def __repr__(self): |
@@ -151,8 +146,12 b' def test_pprint_break_repr():' | |||
|
151 | 146 | """ |
|
152 | 147 | Test that p.break_ is used in repr |
|
153 | 148 | """ |
|
154 |
output = pretty.pretty(BreakingRepr |
|
|
155 |
expected = " |
|
|
149 | output = pretty.pretty([[BreakingRepr()]]) | |
|
150 | expected = "[[Breaking(\n )]]" | |
|
151 | nt.assert_equal(output, expected) | |
|
152 | ||
|
153 | output = pretty.pretty([[BreakingRepr()]*2]) | |
|
154 | expected = "[[Breaking(\n ),\n Breaking(\n )]]" | |
|
156 | 155 | nt.assert_equal(output, expected) |
|
157 | 156 | |
|
158 | 157 | def test_bad_repr(): |
General Comments 0
You need to be logged in to leave comments.
Login now