Skip to content

Commit f120a01

Browse files
committed
adjusting unit tests a bit
1 parent 27377ba commit f120a01

12 files changed

+280
-250
lines changed

test/pytest/test_coordinates.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@
66

77
import NumCppPy as NumCpp # noqa E402
88

9-
np.random.seed(666)
9+
10+
####################################################################################
11+
def test_seed():
12+
np.random.seed(666)
1013

1114

1215
####################################################################################

test/pytest/test_datacube.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
import NumCppPy as NumCpp # noqa E402
66

7-
np.random.seed(666)
7+
8+
####################################################################################
9+
def test_seed():
10+
np.random.seed(666)
811

912

1013
####################################################################################

test/pytest/test_filters.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
####################################################################################
1717
def test_seed():
18-
np.random.seed(12)
18+
np.random.seed(523)
1919

2020

2121
####################################################################################
@@ -435,7 +435,7 @@ def test_percentileFilter1d():
435435
cval=constantValue,
436436
extra_arguments=(percentile,),
437437
)
438-
assert np.array_equal(np.round(dataOutC, 7), np.round(dataOutPy, 7))
438+
assert np.array_equal(np.round(dataOutC, 5), np.round(dataOutPy, 5))
439439

440440

441441
####################################################################################

test/pytest/test_functions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9020,7 +9020,7 @@ def test_logspace():
90209020
start = np.random.randint(0, 10)
90219021
stop = np.random.randint(start + 1, 2 * start + 2)
90229022
num = np.random.randint(1, 100)
9023-
base = np.random.rand(1) * 10
9023+
base = np.random.rand(1).item() * 10
90249024
assert np.array_equal(
90259025
np.round(NumCpp.logspace(start, stop, num, NumCpp.EndPoint.YES, base).flatten(), 8),
90269026
np.round(np.logspace(start=start, stop=stop, num=num, endpoint=True, base=base).flatten(), 8),

test/pytest/test_imageprocessing.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,14 @@
33

44
import NumCppPy as NumCpp # noqa E402
55

6-
np.random.seed(666)
76

87
DO_TEST = False
98
PLOT_SHOW = False
109

10+
####################################################################################
11+
def test_seed():
12+
np.random.seed(666)
13+
1114

1215
####################################################################################
1316
def test_imageProcessing():

test/pytest/test_linalg.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22

33
import NumCppPy as NumCpp # noqa E402
44

5-
np.random.seed(666)
5+
6+
####################################################################################
7+
def test_seed():
8+
np.random.seed(666)
69

710

811
####################################################################################

0 commit comments

Comments
 (0)