MCPcopy Index your code
hub / github.com/python/cpython / test_odd_decimals

Method test_odd_decimals

Lib/test/test_statistics.py:1756–1762  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1754 self.assertEqual(self.func(data), 3.25)
1755
1756 def test_odd_decimals(self):
1757 # Test median_grouped works with an odd number of Decimals.
1758 D = Decimal
1759 data = [D('5.5'), D('6.5'), D('6.5'), D('7.5'), D('8.5')]
1760 assert len(data)%2 == 1
1761 random.shuffle(data)
1762 self.assertEqual(self.func(data), 6.75)
1763
1764 def test_even_decimals(self):
1765 # Test median_grouped works with an even number of Decimals.

Callers

nothing calls this directly

Calls 4

shuffleMethod · 0.80
DClass · 0.70
assertEqualMethod · 0.45
funcMethod · 0.45

Tested by

no test coverage detected