[Python-checkins] cpython (3.4): Issue #21881: Just omit tests for platform-specific NaN representation in

serhiy.storchaka python-checkins at python.org
Mon Jul 7 14:20:21 CEST 2014


http://hg.python.org/cpython/rev/5ac811cbec87
changeset:   91578:5ac811cbec87
branch:      3.4
parent:      91573:f426bd85f808
user:        Serhiy Storchaka <storchaka at gmail.com>
date:        Mon Jul 07 14:57:08 2014 +0300
summary:
  Issue #21881: Just omit tests for platform-specific NaN representation in test_tcl.

files:
  Lib/test/test_tcl.py |  8 ++------
  1 files changed, 2 insertions(+), 6 deletions(-)


diff --git a/Lib/test/test_tcl.py b/Lib/test/test_tcl.py
--- a/Lib/test/test_tcl.py
+++ b/Lib/test/test_tcl.py
@@ -406,11 +406,9 @@
             self.assertEqual(passValue(float('inf')), float('inf'))
             self.assertEqual(passValue(-float('inf')), -float('inf'))
         else:
-            f = passValue(float('nan'))
-            self.assertIsInstance(f, str)
-            self.assertEqual(f.lower()[:3], 'nan')
             self.assertEqual(float(passValue(float('inf'))), float('inf'))
             self.assertEqual(float(passValue(-float('inf'))), -float('inf'))
+            # XXX NaN representation can be not parsable by float()
         self.assertEqual(passValue((1, '2', (3.4,))),
                          (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4')
 
@@ -432,8 +430,6 @@
             expected = float(expected)
             self.assertAlmostEqual(float(actual), expected,
                                    delta=abs(expected) * 1e-10)
-        def starts_with(actual, expected):
-            self.assertEqual(actual.lower()[:len(expected)], expected)
 
         check(True, '1')
         check(False, '0')
@@ -456,7 +452,7 @@
             check(f, f, eq=float_eq)
         check(float('inf'), 'Inf', eq=float_eq)
         check(-float('inf'), '-Inf', eq=float_eq)
-        check(float('nan'), 'nan', eq=starts_with)
+        # XXX NaN representation can be not parsable by float()
         check((), '')
         check((1, (2,), (3, 4), '5 6', ()), '1 2 {3 4} {5 6} {}')
 

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


More information about the Python-checkins mailing list