Show More
@@ -213,4 +213,20 b' def test_long_dict():' | |||||
213 |
|
213 | |||
214 | def test_unbound_method(): |
|
214 | def test_unbound_method(): | |
215 | output = pretty.pretty(MyObj.somemethod) |
|
215 | output = pretty.pretty(MyObj.somemethod) | |
216 | nt.assert_in('MyObj.somemethod', output) No newline at end of file |
|
216 | nt.assert_in('MyObj.somemethod', output) | |
|
217 | ||||
|
218 | ||||
|
219 | class MetaClass(type): | |||
|
220 | def __new__(cls, name): | |||
|
221 | return type.__new__(cls, name, (object,), {'name': name}) | |||
|
222 | ||||
|
223 | def __repr__(self): | |||
|
224 | return "[CUSTOM REPR FOR CLASS %s]" % self.name | |||
|
225 | ||||
|
226 | ||||
|
227 | ClassWithMeta = MetaClass('ClassWithMeta') | |||
|
228 | ||||
|
229 | ||||
|
230 | def test_metaclass_repr(): | |||
|
231 | output = pretty.pretty(ClassWithMeta) | |||
|
232 | nt.assert_equal(output, "[CUSTOM REPR FOR CLASS ClassWithMeta]") |
General Comments 0
You need to be logged in to leave comments.
Login now