(self)
| 1244 | |
| 1245 | class SumTortureTest(NumericTestCase): |
| 1246 | def test_torture(self): |
| 1247 | # Tim Peters' torture test for sum, and variants of same. |
| 1248 | self.assertEqual(statistics._sum([1, 1e100, 1, -1e100]*10000), |
| 1249 | (float, Fraction(20000.0), 40000)) |
| 1250 | self.assertEqual(statistics._sum([1e100, 1, 1, -1e100]*10000), |
| 1251 | (float, Fraction(20000.0), 40000)) |
| 1252 | T, num, count = statistics._sum([1e-100, 1, 1e-100, -1]*10000) |
| 1253 | self.assertIs(T, float) |
| 1254 | self.assertEqual(count, 40000) |
| 1255 | self.assertApproxEqual(float(num), 2.0e-96, rel=5e-16) |
| 1256 | |
| 1257 | |
| 1258 | class SumSpecialValues(NumericTestCase): |
nothing calls this directly
no test coverage detected