Skip to content

Commit

Permalink
Conditionally reference float128 in numpy test. (#707)
Browse files Browse the repository at this point in the history
The float128 attribute does not exist on every platform, such as on ARM
macOS systems.
  • Loading branch information
tjni authored Jul 16, 2023
1 parent 9adc9f6 commit a7013c3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tests/test_numpy.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,9 @@ def test_scalar(self):
assert isinstance(res, np.ndarray) and res.shape == (1,)
res = x2num.make_np(np.float16(1.00000087))
assert isinstance(res, np.ndarray) and res.shape == (1,)
res = x2num.make_np(np.float128(1.00008 + 9))
assert isinstance(res, np.ndarray) and res.shape == (1,)
if hasattr(np, 'float128'):
res = x2num.make_np(np.float128(1.00008 + 9))
assert isinstance(res, np.ndarray) and res.shape == (1,)
res = x2num.make_np(np.int64(100000000000))
assert isinstance(res, np.ndarray) and res.shape == (1,)

Expand Down

0 comments on commit a7013c3

Please sign in to comment.