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

Method test_domain_error_regression

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

Source from the content-addressed store, hash-verified

1961 self.assertEqual(self.func(data), 0)
1962
1963 def test_domain_error_regression(self):
1964 # Regression test for a domain error exception.
1965 # (Thanks to Geremy Condra.)
1966 data = [0.123456789012345]*10000
1967 # All the items are identical, so variance should be exactly zero.
1968 # We allow some small round-off error, but not much.
1969 result = self.func(data)
1970 self.assertApproxEqual(result, 0.0, tol=5e-17)
1971 self.assertGreaterEqual(result, 0) # A negative result must fail.
1972
1973 def test_shift_data(self):
1974 # Test that shifting the data by a constant amount does not affect

Callers

nothing calls this directly

Calls 3

assertApproxEqualMethod · 0.80
assertGreaterEqualMethod · 0.80
funcMethod · 0.45

Tested by

no test coverage detected