5
5
import numpy
6
6
7
7
8
- @pytest .mark .parametrize ("type" ,
9
- [numpy .int64 ],
10
- ids = ['int64' ])
8
+ @pytest .mark .parametrize ("type" , [numpy .int64 ], ids = ["int64" ])
11
9
def test_abs_int (type ):
12
10
a = numpy .array ([1 , 0 , 2 , - 3 , - 1 , 2 , 21 , - 9 ])
13
11
ia = inp .array (a )
@@ -17,9 +15,7 @@ def test_abs_int(type):
17
15
numpy .testing .assert_array_equal (expected , result )
18
16
19
17
20
- @pytest .mark .parametrize ("type" ,
21
- [numpy .int64 ],
22
- ids = ['int64' ])
18
+ @pytest .mark .parametrize ("type" , [numpy .int64 ], ids = ["int64" ])
23
19
def test_absolute_int (type ):
24
20
a = numpy .array ([1 , 0 , 2 , - 3 , - 1 , 2 , 21 , - 9 ])
25
21
ia = inp .array (a )
@@ -29,24 +25,28 @@ def test_absolute_int(type):
29
25
numpy .testing .assert_array_equal (expected , result )
30
26
31
27
32
- @pytest .mark .parametrize ("type" ,
33
- [numpy .float64 ],
34
- ids = [pytest .floatMAX ])
28
+ @pytest .mark .parametrize ("type" , [numpy .float64 ], ids = [pytest .floatMAX ])
35
29
def test_absolute_float (type ):
36
- a = numpy .array ([[- 2. , 3. , 9.1 ], [- 2. , 5.0 , - 2 ], [1.0 , - 2. , 5.0 ]], dtype = pytest .floatMAX )
30
+ a = numpy .array (
31
+ [[- 2.0 , 3.0 , 9.1 ], [- 2.0 , 5.0 , - 2 ], [1.0 , - 2.0 , 5.0 ]], dtype = pytest .floatMAX
32
+ )
37
33
ia = inp .array (a )
38
34
39
35
result = inp .absolute (ia )
40
36
expected = numpy .absolute (a )
41
37
numpy .testing .assert_array_equal (expected , result )
42
38
43
39
44
- @pytest .mark .parametrize ("type" ,
45
- [numpy .float64 ],
46
- ids = [pytest .floatMAX ])
40
+ @pytest .mark .parametrize ("type" , [numpy .float64 ], ids = [pytest .floatMAX ])
47
41
def test_absolute_float_3 (type ):
48
- a = numpy .array ([[[- 2. , 3. ], [9.1 , 0.2 ]], [[- 2. , 5.0 ], [- 2 , - 1.2 ]], [[1.0 , - 2. ], [5.0 , - 1.1 ]]],
49
- dtype = pytest .floatMAX )
42
+ a = numpy .array (
43
+ [
44
+ [[- 2.0 , 3.0 ], [9.1 , 0.2 ]],
45
+ [[- 2.0 , 5.0 ], [- 2 , - 1.2 ]],
46
+ [[1.0 , - 2.0 ], [5.0 , - 1.1 ]],
47
+ ],
48
+ dtype = pytest .floatMAX ,
49
+ )
50
50
ia = inp .array (a )
51
51
52
52
result = inp .absolute (ia )
0 commit comments