diff options
author | Tobias Pitters <tobias.pitters@gmail.com> | 2020-05-27 23:57:30 +0200 |
---|---|---|
committer | Tobias Pitters <tobias.pitters@gmail.com> | 2020-05-27 23:57:30 +0200 |
commit | 949bda505d226150bae0d7324ca675899c8396b9 (patch) | |
tree | 3ebea4b67403ab0849b81a0b7f5c8106bbc6c633 | |
parent | eca2642d6ef92287fed64c59c30bcecfc6082857 (diff) | |
download | numpy-949bda505d226150bae0d7324ca675899c8396b9.tar.gz |
refactor quantile tests
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index b9ee49f16..3c0c8ca89 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -3113,16 +3113,14 @@ class TestQuantile: # test that the return value of quantile is monotonic if p0 is ordered p0 = np.arange(0, 1, 0.01) quantile = np.quantile(np.array([0, 1, 1, 2, 2, 3, 3, 4, 5, 5, 1, 1, 9, 9, 9, 8, 8, 7]) * 0.1, p0) - equals_sorted = np.sort(quantile) == quantile - assert equals_sorted.all() + assert_equal(np.sort(quantile), quantile) @hypothesis.given(arr=arrays(dtype=np.float, shape=st.integers(min_value=3, max_value=1000), elements=st.floats(allow_infinity=False, allow_nan=False))) def test_quantile_monotonic_hypo(self, arr): p0 = np.arange(0, 1, 0.01) quantile = np.quantile(arr, p0) - equals_sorted = np.sort(quantile) == quantile - assert equals_sorted.all() + assert_equal(np.sort(quantile), quantile) class TestLerp: |