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

Function test_pop

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

Source from the content-addressed store, hash-verified

201 nt.assert_in(C, f)
202
203def test_pop():
204 f = PlainTextFormatter()
205 f.for_type(C, foo_printer)
206 nt.assert_is(f.lookup_by_type(C), foo_printer)
207 nt.assert_is(f.pop(C, None), foo_printer)
208 f.for_type(C, foo_printer)
209 nt.assert_is(f.pop(C), foo_printer)
210 with nt.assert_raises(KeyError):
211 f.lookup_by_type(C)
212 with nt.assert_raises(KeyError):
213 f.pop(C)
214 with nt.assert_raises(KeyError):
215 f.pop(A)
216 nt.assert_is(f.pop(A, None), None)
217
218def test_pop_string():
219 f = PlainTextFormatter()

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected