|
1 | 1 | import pytest
|
| 2 | +from .helper import get_all_dtypes |
2 | 3 | import numpy
|
3 | 4 | import dpnp
|
4 | 5 |
|
5 | 6 |
|
| 7 | +dtypes_list = get_all_dtypes(no_none=True, no_complex=True) |
6 | 8 | testdata = []
|
7 |
| -testdata += [([True, False, True], dtype) for dtype in ['float32', 'float64', 'int32', 'int64', 'bool']] |
8 |
| -testdata += [([1, -1, 0], dtype) for dtype in ['float32', 'float64', 'int32', 'int64']] |
9 |
| -testdata += [([0.1, 0.0, -0.1], dtype) for dtype in ['float32', 'float64']] |
10 |
| -testdata += [([1j, -1j, 1 - 2j], dtype) for dtype in ['complex128']] |
| 9 | +testdata += [([True, False, True], dtype) for dtype in dtypes_list] |
| 10 | +testdata += [ |
| 11 | + ([1, -1, 0], dtype) |
| 12 | + for dtype in dtypes_list |
| 13 | + if not numpy.issubdtype(dtype, numpy.bool_) |
| 14 | +] |
| 15 | +testdata += [ |
| 16 | + ([0.1, 0.0, -0.1], dtype) |
| 17 | + for dtype in dtypes_list |
| 18 | + if numpy.issubdtype(dtype, numpy.floating) |
| 19 | +] |
| 20 | +testdata += [ |
| 21 | + ([1j, -1j, 1 - 2j], dtype) |
| 22 | + for dtype in ["complex128"] |
| 23 | + if numpy.complex128 in get_all_dtypes(no_none=True, no_bool=True) |
| 24 | +] |
11 | 25 |
|
12 | 26 |
|
13 | 27 | @pytest.mark.parametrize("in_obj,out_dtype", testdata)
|
|
0 commit comments