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

Method test_interval

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

Source from the content-addressed store, hash-verified

1775 self.assertEqual(self.func(data), 7.0)
1776
1777 def test_interval(self):
1778 # Test median_grouped with interval argument.
1779 data = [2.25, 2.5, 2.5, 2.75, 2.75, 3.0, 3.0, 3.25, 3.5, 3.75]
1780 self.assertEqual(self.func(data, 0.25), 2.875)
1781 data = [2.25, 2.5, 2.5, 2.75, 2.75, 2.75, 3.0, 3.0, 3.25, 3.5, 3.75]
1782 self.assertApproxEqual(self.func(data, 0.25), 2.83333333, tol=1e-8)
1783 data = [220, 220, 240, 260, 260, 260, 260, 280, 280, 300, 320, 340]
1784 self.assertEqual(self.func(data, 20), 265.0)
1785
1786 def test_data_type_error(self):
1787 # Test median_grouped with str, bytes data types for data and interval

Callers

nothing calls this directly

Calls 3

assertApproxEqualMethod · 0.80
assertEqualMethod · 0.45
funcMethod · 0.45

Tested by

no test coverage detected