]> granicus.if.org Git - python/commitdiff
Tighten up test of harmonic mean on a single value.
authorSteven D'Aprano <steve@pearwood.info>
Tue, 9 Aug 2016 03:19:48 +0000 (13:19 +1000)
committerSteven D'Aprano <steve@pearwood.info>
Tue, 9 Aug 2016 03:19:48 +0000 (13:19 +1000)
Lib/test/test_statistics.py

index 1542d6460a44054ec2f91d05769334d2f0e1f61d..4b3fd364a78fdc4aee69e77fabd6eb35fd0a1c6d 100644 (file)
@@ -1469,10 +1469,7 @@ class TestHarmonicMean(NumericTestCase, AverageMixin, UnivariateTypeMixin):
     def test_singleton_lists(self):
         # Test that harmonic mean([x]) returns (approximately) x.
         for x in range(1, 101):
-            if x in (49, 93, 98, 99):
-                self.assertApproxEqual(self.func([x]), x, tol=2e-14)
-            else:
-                self.assertEqual(self.func([x]), x)
+            self.assertEqual(self.func([x]), x)
 
     def test_decimals_exact(self):
         # Test harmonic mean with some carefully chosen Decimals.