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

Method test_iter_list_same

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

Source from the content-addressed store, hash-verified

1994 self.assertEqual(self.func(data), expected)
1995
1996 def test_iter_list_same(self):
1997 # Test that iter data and list data give the same result.
1998
1999 # This is an explicit test that iterators and lists are treated the
2000 # same; justification for this test over and above the similar test
2001 # in UnivariateCommonMixin is that an earlier design had variance and
2002 # friends swap between one- and two-pass algorithms, which would
2003 # sometimes give different results.
2004 data = [random.uniform(-3, 8) for _ in range(1000)]
2005 expected = self.func(data)
2006 self.assertEqual(self.func(iter(data)), expected)
2007
2008class TestPVariance(VarianceStdevMixin, NumericTestCase, UnivariateTypeMixin):
2009 # Tests for population variance.

Callers

nothing calls this directly

Calls 3

uniformMethod · 0.80
funcMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected