MCPcopy Create free account
hub / github.com/microsoft/SandDance / mock_comm

Function mock_comm

python/jupyter-widget/sanddance/tests/conftest.py:34–48  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

32
33@pytest.fixture
34def mock_comm():
35 _widget_attrs['_comm_default'] = getattr(Widget, '_comm_default', undefined)
36 Widget._comm_default = lambda self: MockComm()
37 _widget_attrs['_ipython_display_'] = Widget._ipython_display_
38 def raise_not_implemented(*args, **kwargs):
39 raise NotImplementedError()
40 Widget._ipython_display_ = raise_not_implemented
41
42 yield MockComm()
43
44 for attr, value in _widget_attrs.items():
45 if value is undefined:
46 delattr(Widget, attr)
47 else:
48 setattr(Widget, attr, value)

Callers

nothing calls this directly

Calls 1

MockCommClass · 0.85

Tested by

no test coverage detected