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

Function test_pop_string

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

Source from the content-addressed store, hash-verified

216 nt.assert_is(f.pop(A, None), None)
217
218def test_pop_string():
219 f = PlainTextFormatter()
220 type_str = '%s.%s' % (C.__module__, 'C')
221
222 with nt.assert_raises(KeyError):
223 f.pop(type_str)
224
225 f.for_type(type_str, foo_printer)
226 f.pop(type_str)
227 with nt.assert_raises(KeyError):
228 f.lookup_by_type(C)
229 with nt.assert_raises(KeyError):
230 f.pop(type_str)
231
232 f.for_type(C, foo_printer)
233 nt.assert_is(f.pop(type_str, None), foo_printer)
234 with nt.assert_raises(KeyError):
235 f.lookup_by_type(C)
236 with nt.assert_raises(KeyError):
237 f.pop(type_str)
238 nt.assert_is(f.pop(type_str, None), None)
239
240
241def test_error_method():

Callers

nothing calls this directly

Calls 4

PlainTextFormatterClass · 0.90
popMethod · 0.80
for_typeMethod · 0.80
lookup_by_typeMethod · 0.80

Tested by

no test coverage detected