Skip to content

Commit 871fbc5

Browse files
authored
tests: add requirements to dev-requirements (#543)
1 parent e5c2129 commit 871fbc5

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

dev-requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1+
cloudpickle
12
dataclasses; python_version<'3.7'
3+
hypothesis >=6.0
24
numpy
35
pytest !=6.1.0
46
pytest-benchmark

tests/test_accumulators.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ def test_mean():
9494

9595

9696
float_st = st.floats(
97-
allow_nan=False, allow_infinity=False, min_value=-1e30, max_value=1e30
97+
allow_nan=False, allow_infinity=False, min_value=-1e5, max_value=1e5
9898
)
9999
simple_list_st = st.lists(float_st, min_size=1, max_size=10)
100100

@@ -115,12 +115,12 @@ def test_sum_mean(list1, list2):
115115

116116
ab = a + b
117117
assert ab.value == approx(c.value)
118-
assert ab.variance == approx(c.variance, nan_ok=True)
118+
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
119119
assert ab.count == approx(c.count)
120120

121121
a += b
122122
assert a.value == approx(c.value)
123-
assert a.variance == approx(c.variance, nan_ok=True)
123+
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
124124
assert a.count == approx(c.count)
125125

126126

@@ -129,7 +129,7 @@ def test_sum_mean(list1, list2):
129129
st.lists(float_st, min_size=n, max_size=n),
130130
st.lists(
131131
st.floats(
132-
allow_nan=False, allow_infinity=False, min_value=1e-30, max_value=1e30
132+
allow_nan=False, allow_infinity=False, min_value=1e-4, max_value=1e5
133133
),
134134
min_size=n,
135135
max_size=n,
@@ -151,12 +151,12 @@ def test_sum_weighed_mean(pair1, pair2):
151151

152152
ab = a + b
153153
assert ab.value == approx(c.value)
154-
assert ab.variance == approx(c.variance, nan_ok=True)
154+
assert ab.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
155155
assert ab.sum_of_weights == approx(c.sum_of_weights)
156156
assert ab.sum_of_weights_squared == approx(c.sum_of_weights_squared)
157157

158158
a += b
159159
assert a.value == approx(c.value)
160-
assert a.variance == approx(c.variance, nan_ok=True)
160+
assert a.variance == approx(c.variance, nan_ok=True, abs=1e-9, rel=1e-9)
161161
assert a.sum_of_weights == approx(c.sum_of_weights)
162162
assert a.sum_of_weights_squared == approx(c.sum_of_weights_squared)

0 commit comments

Comments
 (0)