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

Function test_pass_correct_include_exclude

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

Source from the content-addressed store, hash-verified

474
475
476def test_pass_correct_include_exclude():
477 class Tester(object):
478
479 def __init__(self, include=None, exclude=None):
480 self.include = include
481 self.exclude = exclude
482
483 def _repr_mimebundle_(self, include, exclude, **kwargs):
484 if include and (include != self.include):
485 raise ValueError('include got modified: display() may be broken.')
486 if exclude and (exclude != self.exclude):
487 raise ValueError('exclude got modified: display() may be broken.')
488
489 return None
490
491 include = {'a', 'b', 'c'}
492 exclude = {'c', 'e' , 'f'}
493
494 f = get_ipython().display_formatter
495 f.format(Tester(include=include, exclude=exclude), include=include, exclude=exclude)
496 f.format(Tester(exclude=exclude), exclude=exclude)
497 f.format(Tester(include=include), include=include)
498
499
500def test_repr_mime_meta():

Callers

nothing calls this directly

Calls 3

get_ipythonFunction · 0.90
TesterClass · 0.70
formatMethod · 0.45

Tested by

no test coverage detected