MCPcopy Index your code
hub / github.com/ipython/ipython / test_basic_class

Function test_basic_class

tests/test_pretty.py:294–310  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

292
293
294def test_basic_class():
295 def type_pprint_wrapper(obj, p, cycle):
296 if obj is MyObj:
297 type_pprint_wrapper.called = True
298 return pretty._type_pprint(obj, p, cycle)
299
300 type_pprint_wrapper.called = False
301
302 stream = StringIO()
303 printer = pretty.RepresentationPrinter(stream)
304 printer.type_pprinters[type] = type_pprint_wrapper
305 printer.pretty(MyObj)
306 printer.flush()
307 output = stream.getvalue()
308
309 assert output == "%s.MyObj" % __name__
310 assert type_pprint_wrapper.called is True
311
312
313def test_collections_userlist():

Callers

nothing calls this directly

Calls 2

prettyMethod · 0.95
flushMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…