Skip to content

Commit beb1a97

Browse files
committed
Restore old assertion and mark xfail
1 parent 70b4918 commit beb1a97

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(reason="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())
@@ -57,7 +59,11 @@ def test_editor_loads_native(colormap_file):
5759

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

6268

6369
# import matplotlib as mpl

0 commit comments

Comments
 (0)