Skip to content

Commit 3216f1f

Browse files
committed
Array editor interactive test: added variable_size support
1 parent db64abc commit 3216f1f

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

guidata/tests/widgets/test_arrayeditor.py

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,29 @@
1717
from guidata.widgets.arrayeditor import ArrayEditor
1818

1919

20-
def launch_arrayeditor(data, title="", xlabels=None, ylabels=None):
20+
def launch_arrayeditor(data, title="", xlabels=None, ylabels=None, variable_size=False):
2121
"""Helper routine to launch an arrayeditor and return its result"""
2222
dlg = ArrayEditor()
23-
dlg.setup_and_check(data, title, xlabels=xlabels, ylabels=ylabels)
23+
dlg.setup_and_check(
24+
data, title, xlabels=xlabels, ylabels=ylabels, variable_size=variable_size
25+
)
2426
exec_dialog(dlg)
2527
return dlg.get_value()
2628

2729

2830
def test_arrayeditor():
2931
"""Test array editor for all supported data types"""
3032
with qt_app_context():
33+
# Variable size version
34+
for title, data in (
35+
("string array", np.array(["kjrekrjkejr"])),
36+
(
37+
"masked array",
38+
np.ma.array([[1, 0], [1, 0]], mask=[[True, False], [False, False]]),
39+
),
40+
("int array", np.array([1, 2, 3], dtype="int8")),
41+
):
42+
launch_arrayeditor(data, "[Variable size] " + title, variable_size=True)
3143
for title, data in (
3244
("string array", np.array(["kjrekrjkejr"])),
3345
("unicode array", np.array(["ñññéáíó"])),

0 commit comments

Comments
 (0)