diff options
author | Raymond Hettinger <rhettinger@users.noreply.github.com> | 2022-05-09 02:08:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-09 02:08:41 -0500 |
commit | e01eeb7b4b8d00b9f5c6acb48957f46ac4e252c0 (patch) | |
tree | ddbd5234dd8bc3083003567836c2699c3696b19a /Lib/test/test_statistics.py | |
parent | 5bc2390229bbcb4f13359e867fd8a140a1d5496b (diff) | |
download | cpython-e01eeb7b4b8d00b9f5c6acb48957f46ac4e252c0.tar.gz cpython-e01eeb7b4b8d00b9f5c6acb48957f46ac4e252c0.zip |
Fix inconsistent return type for statistics median_grouped() gh-92531 (#92533)
Diffstat (limited to 'Lib/test/test_statistics.py')
-rw-r--r-- | Lib/test/test_statistics.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py index ed6021d60bd..6de98241c29 100644 --- a/Lib/test/test_statistics.py +++ b/Lib/test/test_statistics.py @@ -1742,6 +1742,12 @@ class TestMedianGrouped(TestMedian): data = [x]*count self.assertEqual(self.func(data), float(x)) + def test_single_value(self): + # Override method from AverageMixin. + # Average of a single value is the value as a float. + for x in (23, 42.5, 1.3e15, Fraction(15, 19), Decimal('0.28')): + self.assertEqual(self.func([x]), float(x)) + def test_odd_fractions(self): # Test median_grouped works with an odd number of Fractions. F = Fraction |