[Python-checkins] cpython (merge 3.4 -> default): Issue #21881: Just omit tests for platform-specific NaN representation in
serhiy.storchaka
python-checkins at python.org
Mon Jul 7 14:20:23 CEST 2014
http://hg.python.org/cpython/rev/f138a74ee611
changeset: 91579:f138a74ee611
parent: 91574:cace5cc29df0
parent: 91578:5ac811cbec87
user: Serhiy Storchaka <storchaka at gmail.com>
date: Mon Jul 07 14:57:57 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')
self.assertEqual(passValue(['a', ['b', 'c']]),
@@ -434,8 +432,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')
@@ -458,7 +454,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} {}')
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