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

Function test_pop_string

tests/test_formatters.py:274–294  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

272
273
274def test_pop_string():
275 f = PlainTextFormatter()
276 type_str = "%s.%s" % (C.__module__, "C")
277
278 with pytest.raises(KeyError):
279 f.pop(type_str)
280
281 f.for_type(type_str, foo_printer)
282 f.pop(type_str)
283 with pytest.raises(KeyError):
284 f.lookup_by_type(C)
285 with pytest.raises(KeyError):
286 f.pop(type_str)
287
288 f.for_type(C, foo_printer)
289 assert f.pop(type_str, None) is foo_printer
290 with pytest.raises(KeyError):
291 f.lookup_by_type(C)
292 with pytest.raises(KeyError):
293 f.pop(type_str)
294 assert f.pop(type_str, None) is None
295
296
297def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…