diff options
Diffstat (limited to 'numpy/lib/tests')
-rw-r--r-- | numpy/lib/tests/test_function_base.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/numpy/lib/tests/test_function_base.py b/numpy/lib/tests/test_function_base.py index 56081b4f0..277843222 100644 --- a/numpy/lib/tests/test_function_base.py +++ b/numpy/lib/tests/test_function_base.py @@ -421,6 +421,11 @@ class TestAverage: w /= w.sum() assert_almost_equal(a.mean(0), average(a, weights=w)) + def test_average_class_without_dtype(self): + # see gh-21988 + a = np.array([Fraction(1, 5), Fraction(3, 5)]) + assert_equal(np.average(a), Fraction(2, 5)) + class TestSelect: choices = [np.array([1, 2, 3]), np.array([4, 5, 6]), |