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

Method test_regression_25177

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

Source from the content-addressed store, hash-verified

1422 self.assertEqual(statistics.mean([d]), d)
1423
1424 def test_regression_25177(self):
1425 # Regression test for issue 25177.
1426 # Ensure very big and very small floats don't overflow.
1427 # See http://bugs.python.org/issue25177.
1428 self.assertEqual(statistics.mean(
1429 [8.988465674311579e+307, 8.98846567431158e+307]),
1430 8.98846567431158e+307)
1431 big = 8.98846567431158e+307
1432 tiny = 5e-324
1433 for n in (2, 3, 5, 200):
1434 self.assertEqual(statistics.mean([big]*n), big)
1435 self.assertEqual(statistics.mean([tiny]*n), tiny)
1436
1437
1438class TestHarmonicMean(NumericTestCase, AverageMixin, UnivariateTypeMixin):

Callers

nothing calls this directly

Calls 2

meanMethod · 0.80
assertEqualMethod · 0.45

Tested by

no test coverage detected