Skip to content

Commit 73c068f

Browse files
author
AzeezIsh
committed
Added proper imports.
1 parent c414f5f commit 73c068f

File tree

1 file changed

+16
-15
lines changed

1 file changed

+16
-15
lines changed

tests/test_trig.py

+16-15
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import arrayfire_wrapper.dtypes as dtype
66
import arrayfire_wrapper.lib as wrapper
77

8-
from . import utility_functions as util
8+
from tests.utility_functions import check_type_supported, get_all_types, get_float_types
9+
910

1011

1112
@pytest.mark.parametrize(
@@ -18,10 +19,10 @@
1819
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
1920
],
2021
)
21-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
22+
@pytest.mark.parametrize("dtype_name", get_all_types())
2223
def test_asin_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
2324
"""Test inverse sine operation across all supported data types."""
24-
util.check_type_supported(dtype_name)
25+
check_type_supported(dtype_name)
2526
values = wrapper.randu(shape, dtype_name)
2627
result = wrapper.asin(values)
2728
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa
@@ -37,10 +38,10 @@ def test_asin_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
3738
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
3839
],
3940
)
40-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
41+
@pytest.mark.parametrize("dtype_name", get_all_types())
4142
def test_acos_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
4243
"""Test inverse cosine operation across all supported data types."""
43-
util.check_type_supported(dtype_name)
44+
check_type_supported(dtype_name)
4445
values = wrapper.randu(shape, dtype_name)
4546
result = wrapper.acos(values)
4647
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa
@@ -56,10 +57,10 @@ def test_acos_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
5657
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
5758
],
5859
)
59-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
60+
@pytest.mark.parametrize("dtype_name", get_all_types())
6061
def test_atan_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
6162
"""Test inverse tan operation across all supported data types."""
62-
util.check_type_supported(dtype_name)
63+
check_type_supported(dtype_name)
6364
values = wrapper.randu(shape, dtype_name)
6465
result = wrapper.atan(values)
6566
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa
@@ -75,10 +76,10 @@ def test_atan_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
7576
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
7677
],
7778
)
78-
@pytest.mark.parametrize("dtype_name", util.get_float_types())
79+
@pytest.mark.parametrize("dtype_name", get_float_types())
7980
def test_atan2_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
8081
"""Test inverse tan operation across all supported data types."""
81-
util.check_type_supported(dtype_name)
82+
check_type_supported(dtype_name)
8283
if dtype_name == dtype.f16:
8384
pytest.skip()
8485
lhs = wrapper.randu(shape, dtype_name)
@@ -110,10 +111,10 @@ def test_atan2_unsupported_dtypes(invdtypes: dtype.Dtype) -> None:
110111
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
111112
],
112113
)
113-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
114+
@pytest.mark.parametrize("dtype_name", get_all_types())
114115
def test_cos_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
115116
"""Test cosine operation across all supported data types."""
116-
util.check_type_supported(dtype_name)
117+
check_type_supported(dtype_name)
117118
values = wrapper.randu(shape, dtype_name)
118119
result = wrapper.cos(values)
119120
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa
@@ -129,10 +130,10 @@ def test_cos_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
129130
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
130131
],
131132
)
132-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
133+
@pytest.mark.parametrize("dtype_name", get_all_types())
133134
def test_sin_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
134135
"""Test sin operation across all supported data types."""
135-
util.check_type_supported(dtype_name)
136+
check_type_supported(dtype_name)
136137
values = wrapper.randu(shape, dtype_name)
137138
result = wrapper.sin(values)
138139
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa
@@ -148,10 +149,10 @@ def test_sin_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
148149
(random.randint(1, 10), random.randint(1, 10), random.randint(1, 10), random.randint(1, 10)),
149150
],
150151
)
151-
@pytest.mark.parametrize("dtype_name", util.get_all_types())
152+
@pytest.mark.parametrize("dtype_name", get_all_types())
152153
def test_tan_shape_dtypes(shape: tuple, dtype_name: dtype.Dtype) -> None:
153154
"""Test tan operation across all supported data types."""
154-
util.check_type_supported(dtype_name)
155+
check_type_supported(dtype_name)
155156
values = wrapper.randu(shape, dtype_name)
156157
result = wrapper.tan(values)
157158
assert wrapper.get_dims(result)[0 : len(shape)] == shape, f"failed for shape: {shape}" # noqa

0 commit comments

Comments
 (0)