File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change 9
9
10
10
import pytest
11
11
12
- from jupyter_sphinx .execute import JupyterCellNode , JupyterKernelNode
12
+ from jupyter_sphinx .execute import (
13
+ JupyterCellNode ,
14
+ JupyterKernelNode ,
15
+ JupyterWidgetViewNode ,
16
+ JupyterWidgetStateNode ,
17
+ )
13
18
14
19
@pytest .fixture ()
15
20
def doctree ():
@@ -160,3 +165,15 @@ def test_raises(doctree):
160
165
tree = doctree (source )
161
166
cell , = tree .traverse (JupyterCellNode )
162
167
'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
You can’t perform that action at this time.
0 commit comments