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

Method test_compare_to_variance

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

Source from the content-addressed store, hash-verified

2101 self.func = statistics.pstdev
2102
2103 def test_compare_to_variance(self):
2104 # Test that stdev is, in fact, the square root of variance.
2105 data = [random.uniform(-17, 24) for _ in range(1000)]
2106 expected = math.sqrt(statistics.pvariance(data))
2107 self.assertEqual(self.func(data), expected)
2108
2109 def test_center_not_at_mean(self):
2110 # See issue: 40855

Callers

nothing calls this directly

Calls 4

uniformMethod · 0.80
sqrtMethod · 0.45
assertEqualMethod · 0.45
funcMethod · 0.45

Tested by

no test coverage detected