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

Method test_compare_to_variance

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

Source from the content-addressed store, hash-verified

2229 self.assertRaises(statistics.StatisticsError, self.func, [x])
2230
2231 def test_compare_to_variance(self):
2232 # Test that stdev is, in fact, the square root of variance.
2233 data = [random.uniform(-2, 9) for _ in range(1000)]
2234 expected = math.sqrt(statistics.variance(data))
2235 self.assertAlmostEqual(self.func(data), expected)
2236
2237 def test_center_not_at_mean(self):
2238 data = (1.0, 2.0)

Callers

nothing calls this directly

Calls 5

uniformMethod · 0.80
varianceMethod · 0.80
sqrtMethod · 0.45
assertAlmostEqualMethod · 0.45
funcMethod · 0.45

Tested by

no test coverage detected