Skip to content

Commit 26873c4

Browse files
committedJun 3, 2023
Restore old assertion and mark xfail
1 parent c4a70b8 commit 26873c4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed
 

‎test/test_editor_loads_native.py

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22

3+
import numpy as np
34
import pytest
45

56
from viscm.gui import Colormap, viscm_editor
@@ -17,6 +18,7 @@ def approxeq(x, y, *, err=0.0001):
1718
"viscm/examples/sample_diverging_continuous.jscm",
1819
],
1920
)
21+
@pytest.mark.xfail("Test very old; intent unclear")
2022
def test_editor_loads_native(colormap_file):
2123
with open(colormap_file) as f:
2224
data = json.loads(f.read())
@@ -60,7 +62,11 @@ def test_editor_loads_native(colormap_file):
6062

6163
for i in range(len(colors)):
6264
for z in range(3):
63-
assert approxeq(colors[i][z], editor_colors[i][z], err=0.01)
65+
# FIXME: The right-hand side of this comparison will always be 0.
66+
# https://github.com/matplotlib/viscm/pull/66#discussion_r1213818015
67+
assert colors[i][z] == np.rint(editor_colors[i][z] / 256)
68+
# Should the test look more like this?
69+
# assert approxeq(colors[i][z], editor_colors[i][z], err=0.005)
6470

6571

6672
# import matplotlib as mpl

0 commit comments

Comments
 (0)