amaury.forgeotdarc
2008-09-06 21:03:23 UTC
Author: amaury.forgeotdarc
Date: Sat Sep 6 23:03:22 2008
New Revision: 66271
Log:
I modified the tests a bit to account for unicode string
Merged revisions 66270 via svnmerge from
svn+ssh://pythondev at svn.python.org/python/trunk
........
r66270 | amaury.forgeotdarc | 2008-09-06 22:53:51 +0200 (sam., 06 sept. 2008) | 3 lines
#3796: A test class was not run in test_float.
Reviewed by Benjamin.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/test/test_float.py
Modified: python/branches/py3k/Lib/test/test_float.py
==============================================================================
--- python/branches/py3k/Lib/test/test_float.py (original)
+++ python/branches/py3k/Lib/test/test_float.py Sat Sep 6 23:03:22 2008
@@ -5,6 +5,7 @@
import math
from math import isinf, isnan, copysign, ldexp
import operator
+import random, fractions
INF = float("inf")
NAN = float("nan")
@@ -15,6 +16,7 @@
self.assertEqual(float(3.14), 3.14)
self.assertEqual(float(314), 314.0)
self.assertEqual(float(" 3.14 "), 3.14)
+ self.assertEqual(float(b" 3.14 "), 3.14)
self.assertRaises(ValueError, float, " 0x3.1 ")
self.assertRaises(ValueError, float, " -0x3.p-1 ")
self.assertRaises(ValueError, float, " +0x3.p-1 ")
@@ -22,10 +24,7 @@
self.assertRaises(ValueError, float, "+-3.14")
self.assertRaises(ValueError, float, "-+3.14")
self.assertRaises(ValueError, float, "--3.14")
- self.assertEqual(float(unicode(" 3.14 ")), 3.14)
- self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
- # Implementation limitation in PyFloat_FromString()
- self.assertRaises(ValueError, float, unicode("1"*10000))
+ self.assertEqual(float(b" \u0663.\u0661\u0664 ".decode('raw-unicode-escape')), 3.14)
@support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
def test_float_with_comma(self):
@@ -766,6 +765,7 @@
def test_main():
support.run_unittest(
+ GeneralFloatCases,
FormatFunctionsTestCase,
UnknownFormatTestCase,
IEEEFormatTestCase,
Date: Sat Sep 6 23:03:22 2008
New Revision: 66271
Log:
I modified the tests a bit to account for unicode string
Merged revisions 66270 via svnmerge from
svn+ssh://pythondev at svn.python.org/python/trunk
........
r66270 | amaury.forgeotdarc | 2008-09-06 22:53:51 +0200 (sam., 06 sept. 2008) | 3 lines
#3796: A test class was not run in test_float.
Reviewed by Benjamin.
........
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Lib/test/test_float.py
Modified: python/branches/py3k/Lib/test/test_float.py
==============================================================================
--- python/branches/py3k/Lib/test/test_float.py (original)
+++ python/branches/py3k/Lib/test/test_float.py Sat Sep 6 23:03:22 2008
@@ -5,6 +5,7 @@
import math
from math import isinf, isnan, copysign, ldexp
import operator
+import random, fractions
INF = float("inf")
NAN = float("nan")
@@ -15,6 +16,7 @@
self.assertEqual(float(3.14), 3.14)
self.assertEqual(float(314), 314.0)
self.assertEqual(float(" 3.14 "), 3.14)
+ self.assertEqual(float(b" 3.14 "), 3.14)
self.assertRaises(ValueError, float, " 0x3.1 ")
self.assertRaises(ValueError, float, " -0x3.p-1 ")
self.assertRaises(ValueError, float, " +0x3.p-1 ")
@@ -22,10 +24,7 @@
self.assertRaises(ValueError, float, "+-3.14")
self.assertRaises(ValueError, float, "-+3.14")
self.assertRaises(ValueError, float, "--3.14")
- self.assertEqual(float(unicode(" 3.14 ")), 3.14)
- self.assertEqual(float(unicode(" \u0663.\u0661\u0664 ",'raw-unicode-escape')), 3.14)
- # Implementation limitation in PyFloat_FromString()
- self.assertRaises(ValueError, float, unicode("1"*10000))
+ self.assertEqual(float(b" \u0663.\u0661\u0664 ".decode('raw-unicode-escape')), 3.14)
@support.run_with_locale('LC_NUMERIC', 'fr_FR', 'de_DE')
def test_float_with_comma(self):
@@ -766,6 +765,7 @@
def test_main():
support.run_unittest(
+ GeneralFloatCases,
FormatFunctionsTestCase,
UnknownFormatTestCase,
IEEEFormatTestCase,