MCPcopy Create free account
hub / github.com/ipython/ipython / test_lookup_string

Function test_lookup_string

IPython/core/tests/test_formatters.py:153–161  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

151 f.lookup(A())
152
153def test_lookup_string():
154 f = PlainTextFormatter()
155 type_str = '%s.%s' % (C.__module__, 'C')
156
157 f.for_type(type_str, foo_printer)
158 nt.assert_is(f.lookup(C()), foo_printer)
159 # should move from deferred to imported dict
160 nt.assert_not_in(_mod_name_key(C), f.deferred_printers)
161 nt.assert_in(C, f.type_printers)
162
163def test_lookup_by_type():
164 f = PlainTextFormatter()

Callers

nothing calls this directly

Calls 5

PlainTextFormatterClass · 0.90
_mod_name_keyFunction · 0.90
for_typeMethod · 0.80
lookupMethod · 0.80
CClass · 0.70

Tested by

no test coverage detected