From 32814a288313068f201a834bae66ace550bcdd48 Mon Sep 17 00:00:00 2001 From: Filipe Fernandes Date: Wed, 19 Oct 2022 10:23:50 -0300 Subject: [PATCH] fix windows tests --- tests/test_ciso.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/tests/test_ciso.py b/tests/test_ciso.py index 912f398..e87e235 100644 --- a/tests/test_ciso.py +++ b/tests/test_ciso.py @@ -1,7 +1,7 @@ from __future__ import absolute_import, division, print_function import os - +import sys import numpy as np import pytest @@ -39,21 +39,17 @@ def test_bad_dtypes(data): zslice(np.empty_like(data["q"], dtype=np.str_), data["p"], p0=0) -def test_good_dtypes(data): - # FIXME: Using `np.asfarray` will prevent from using complex dtypes. - # NOTE: There is probably a more "numpy" efficient way to test this. - dtypes = [ - int, - float, - np.integer, - np.float16, - np.float32, - np.float64, - np.float128, - np.floating, - ] - for dtype in dtypes: - zslice(np.empty_like(data["q"], dtype=dtype), data["p"], p0=0) +@pytest.mark.parametrize("dtype", [int, float, np.int32, np.int64, np.float16, np.float32, np.float64]) +def test_good_dtypes(data, dtype): + zslice(np.empty_like(data["q"], dtype=dtype), data["p"], p0=0) + + +@pytest.mark.skipif( + sys.platform in ["win32"], + reason="Windows doesn't provide float128", +) +def test_good_dtypes_float128(data): + zslice(np.empty_like(data["q"], dtype=np.float128), data["p"], p0=0) def test_3D_input(data):