Skip to content

Commit 099bb02

Browse files
committed
Disable the new doc_tests on pyodide
Some of the tests are sufficiently more complicated that differences in numpy are more significant in these new doc_tests than in the previous tests in test_plot_detail.py.
1 parent 067b53e commit 099bb02

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

test/builtin/drawing/doc_tests.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ doc-058:
130130
expr: Plot3D[{x^2 + y^2, -x^2 - y^2}, {x, -2, 2}, {y, -2, 2}, BoxRatios-> Automatic, Mesh->None]
131131
doc-059:
132132
expr: Plot[3, {x, 0, 1}]
133+
skip: pyodide # pyodide emits Real 3 where other platforms emit Integer 3
133134
doc-060:
134135
expr: Plot[Abs[x], {x, -4, 4}]
135136
doc-061:

test/builtin/drawing/test_plot_detail.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -206,17 +206,23 @@ def test_all(act_dir="/tmp", opt=None):
206206
opt = opt if use_opt else None
207207
one_test(name, str_expr, True, opt, act_dir)
208208

209-
for name, info in doc_tests.items():
210-
skip = info.get("skip", False)
211-
if isinstance(skip, str):
212-
skip = {
213-
"pyodide": pyodide, # skip if on pyodide
214-
"skimage": not skimage, # skip if no skimage
215-
}[skip]
216-
if not skip:
217-
one_test(name, info["expr"], False, ..., act_dir)
218-
else:
219-
print(f"skipping {name}")
209+
# several of these tests failed on pyodide due to apparent differences
210+
# in numpy (and/or the blas library backing it) between pyodide and other platforms
211+
# including numerical instability, different data types (integer vs real)
212+
# the tests above seem so far to be ok on pyodide, but generally they are
213+
# simpler than these doc_tests
214+
if not pyodide:
215+
for name, info in doc_tests.items():
216+
skip = info.get("skip", False)
217+
if isinstance(skip, str):
218+
skip = {
219+
"pyodide": pyodide, # skip if on pyodide
220+
"skimage": not skimage, # skip if no skimage
221+
}[skip]
222+
if not skip:
223+
one_test(name, info["expr"], False, ..., act_dir)
224+
else:
225+
print(f"skipping {name}")
220226

221227

222228
# reference files can be generated by pointing saved actual

0 commit comments

Comments
 (0)