##// END OF EJS Templates
Merge pull request #5003 from takluyver/thats-pretty-super...
Brian E. Granger -
r15068:f98dd140 merge
parent child Browse files
Show More
@@ -678,7 +678,7 b' def _dict_pprinter_factory(start, end, basetype=None):'
678 def _super_pprint(obj, p, cycle):
678 def _super_pprint(obj, p, cycle):
679 """The pprint for the super type."""
679 """The pprint for the super type."""
680 p.begin_group(8, '<super: ')
680 p.begin_group(8, '<super: ')
681 p.pretty(obj.__self_class__)
681 p.pretty(obj.__thisclass__)
682 p.text(',')
682 p.text(',')
683 p.breakable()
683 p.breakable()
684 p.pretty(obj.__self__)
684 p.pretty(obj.__self__)
@@ -181,4 +181,19 b' def test_really_bad_repr():'
181 nt.assert_in("failed", output)
181 nt.assert_in("failed", output)
182 nt.assert_in("BadException: unknown", output)
182 nt.assert_in("BadException: unknown", output)
183 nt.assert_in("unknown type", output)
183 nt.assert_in("unknown type", output)
184
185
186 class SA(object):
187 pass
188
189 class SB(SA):
190 pass
191
192 def test_super_repr():
193 output = pretty.pretty(super(SA))
194 nt.assert_in("SA", output)
195
196 sb = SB()
197 output = pretty.pretty(super(SA, sb))
198 nt.assert_in("SA", output)
184 No newline at end of file
199
General Comments 0
You need to be logged in to leave comments. Login now