[Python-checkins] cpython (2.7): Issue #21881: Just omit tests for platform-specific NaN representation in
serhiy.storchaka
python-checkins at python.org
Mon Jul 7 14:20:20 CEST 2014
http://hg.python.org/cpython/rev/01ec8bb7187f
changeset: 91577:01ec8bb7187f
branch: 2.7
parent: 91568:4514804d0e50
user: Serhiy Storchaka <storchaka at gmail.com>
date: Mon Jul 07 14:47:17 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
@@ -420,11 +420,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')
@@ -449,8 +447,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')
@@ -474,7 +470,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