Skip to content

Commit 02e93ee

Browse files
committed
add a minimal test
1 parent 2ce93fc commit 02e93ee

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tests/test_execute.py

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,12 @@
99

1010
import pytest
1111

12-
from jupyter_sphinx.execute import JupyterCellNode, JupyterKernelNode
12+
from jupyter_sphinx.execute import (
13+
JupyterCellNode,
14+
JupyterKernelNode,
15+
JupyterWidgetViewNode,
16+
JupyterWidgetStateNode,
17+
)
1318

1419
@pytest.fixture()
1520
def doctree():
@@ -160,3 +165,15 @@ def test_raises(doctree):
160165
tree = doctree(source)
161166
cell, = tree.traverse(JupyterCellNode)
162167
'ValueError' in cell.children[1].rawsource
168+
169+
170+
def test_widgets(doctree):
171+
source = '''
172+
.. jupyter-execute::
173+
174+
import ipywidgets
175+
ipywidgets.Button()
176+
'''
177+
tree = doctree(source)
178+
assert len(list(tree.traverse(JupyterWidgetViewNode))) == 1
179+
assert len(list(tree.traverse(JupyterWidgetStateNode))) == 1

0 commit comments

Comments
 (0)