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

Method test_order_doesnt_matter

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

Source from the content-addressed store, hash-verified

1061 self.assertListEqual(data, saved, "data has been modified")
1062
1063 def test_order_doesnt_matter(self):
1064 # Test that the order of data points doesn't change the result.
1065
1066 # CAUTION: due to floating-point rounding errors, the result actually
1067 # may depend on the order. Consider this test representing an ideal.
1068 # To avoid this test failing, only test with exact values such as ints
1069 # or Fractions.
1070 data = [1, 2, 3, 3, 3, 4, 5, 6]*100
1071 expected = self.func(data)
1072 random.shuffle(data)
1073 actual = self.func(data)
1074 self.assertEqual(expected, actual)
1075
1076 def test_type_of_data_collection(self):
1077 # Test that the type of iterable data doesn't effect the result.

Callers

nothing calls this directly

Calls 3

shuffleMethod · 0.80
funcMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected