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

Function test_pass_correct_include_exclude

tests/test_formatters.py:537–557  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

535
536
537def test_pass_correct_include_exclude():
538 class Tester(object):
539 def __init__(self, include=None, exclude=None):
540 self.include = include
541 self.exclude = exclude
542
543 def _repr_mimebundle_(self, include, exclude, **kwargs):
544 if include and (include != self.include):
545 raise ValueError("include got modified: display() may be broken.")
546 if exclude and (exclude != self.exclude):
547 raise ValueError("exclude got modified: display() may be broken.")
548
549 return None
550
551 include = {"a", "b", "c"}
552 exclude = {"c", "e", "f"}
553
554 f = get_ipython().display_formatter
555 f.format(Tester(include=include, exclude=exclude), include=include, exclude=exclude)
556 f.format(Tester(exclude=exclude), exclude=exclude)
557 f.format(Tester(include=include), include=include)
558
559
560def 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

Used in the wild real call sites across dependent graphs

searching dependent graphs…