[Python-checkins] cpython: Tighten up test of harmonic mean on a single value.

steven.daprano python-checkins at python.org
Mon Aug 8 23:20:40 EDT 2016


https://hg.python.org/cpython/rev/1fab715bbd43
changeset:   102576:1fab715bbd43
user:        Steven D'Aprano <steve at pearwood.info>
date:        Tue Aug 09 13:19:48 2016 +1000
summary:
  Tighten up test of harmonic mean on a single value.

files:
  Lib/test/test_statistics.py |  5 +----
  1 files changed, 1 insertions(+), 4 deletions(-)


diff --git a/Lib/test/test_statistics.py b/Lib/test/test_statistics.py
--- a/Lib/test/test_statistics.py
+++ b/Lib/test/test_statistics.py
@@ -1469,10 +1469,7 @@
     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.

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list