Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix windows tests #16

Merged
merged 1 commit into from
Oct 19, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 12 additions & 16 deletions tests/test_ciso.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from __future__ import absolute_import, division, print_function

import os

import sys
import numpy as np
import pytest

Expand Down Expand Up @@ -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):
Expand Down