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

Method test_doubled_data

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

Source from the content-addressed store, hash-verified

1528 self.assertEqual(result, expected)
1529
1530 def test_doubled_data(self):
1531 # Harmonic mean of [a,b...z] should be same as for [a,a,b,b...z,z].
1532 data = [random.uniform(1, 5) for _ in range(1000)]
1533 expected = self.func(data)
1534 actual = self.func(data*2)
1535 self.assertApproxEqual(actual, expected)
1536
1537 def test_with_weights(self):
1538 self.assertEqual(self.func([40, 60], [5, 30]), 56.0) # common case

Callers

nothing calls this directly

Calls 3

uniformMethod · 0.80
assertApproxEqualMethod · 0.80
funcMethod · 0.45

Tested by

no test coverage detected