mirror of
https://github.com/python/cpython.git
synced 2025-07-12 13:55:34 +00:00
Fix inconsistent return type for statistics median_grouped() gh-92531 (GH-92533) (#92656)
This commit is contained in:
parent
5197134c1c
commit
951cfc8e54
3 changed files with 22 additions and 14 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue