Show More
@@ -74,6 +74,10 b' class BreakingReprParent(object):' | |||||
74 | with p.group(4,"TG: ",":"): |
|
74 | with p.group(4,"TG: ",":"): | |
75 | p.pretty(BreakingRepr()) |
|
75 | p.pretty(BreakingRepr()) | |
76 |
|
76 | |||
|
77 | class BadRepr(object): | |||
|
78 | ||||
|
79 | def __repr__(self): | |||
|
80 | return 1/0 | |||
77 |
|
81 | |||
78 |
|
82 | |||
79 | def test_indentation(): |
|
83 | def test_indentation(): | |
@@ -150,4 +154,9 b' def test_pprint_break_repr():' | |||||
150 | """ |
|
154 | """ | |
151 | output = pretty.pretty(BreakingReprParent()) |
|
155 | output = pretty.pretty(BreakingReprParent()) | |
152 | expected = "TG: Breaking(\n ):" |
|
156 | expected = "TG: Breaking(\n ):" | |
153 | nt.assert_equal(output, expected) No newline at end of file |
|
157 | nt.assert_equal(output, expected) | |
|
158 | ||||
|
159 | def test_bad_repr(): | |||
|
160 | """Don't raise, even when repr fails""" | |||
|
161 | output = pretty.pretty(BadRepr()) | |||
|
162 | nt.assert_in("failed", output) |
General Comments 0
You need to be logged in to leave comments.
Login now