Skip to content

Commit 428d510

Browse files
committed
Do not type check against float
Turns out int is not the same type as float...
1 parent 1297699 commit 428d510

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/astro_image_display_api/widget_api_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import numbers
12

23
import pytest
3-
44
import numpy as np # noqa: E402
55

66
from astropy.coordinates import SkyCoord # noqa: E402
@@ -170,7 +170,7 @@ def test_viewport_is_defined_aster_loading_image(self, data):
170170
assert isinstance(vport['center'], tuple)
171171
assert 'fov' in vport
172172
# fov should be a float since no WCS
173-
assert isinstance(vport['fov'], float)
173+
assert isinstance(vport['fov'], numbers.Real)
174174
assert 'image_label' in vport
175175
assert vport['image_label'] is None
176176

@@ -229,7 +229,7 @@ def test_get_viewport_sky_or_pixel(self, data, wcs):
229229
assert vport_pixel['center'] == wcs.crpix
230230
# tbh, not at all sure what the fov should be in pixel coordinates,
231231
# so just check that it is a float.
232-
assert isinstance(vport_pixel['fov'], float)
232+
assert isinstance(vport_pixel['fov'], numbers.Real)
233233

234234
# Get the viewport in world coordinates
235235
vport_world = self.image.get_viewport(image_label='test', sky_or_pixel='sky')

0 commit comments

Comments
 (0)