summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
authorAndrew McNamara <andrewm@object-craft.com.au>2005-01-12 09:45:18 (GMT)
committerAndrew McNamara <andrewm@object-craft.com.au>2005-01-12 09:45:18 (GMT)
commit0f0599ddc1ad02f392fe0be58479f34c57a80c8d (patch)
tree15f3ac9b61288a250b28cde1743c702d3129c655 /Lib
parent5d45a8dc2247d6d9f59e57d7719c3d467dd3b40d (diff)
downloadcpython-0f0599ddc1ad02f392fe0be58479f34c57a80c8d.zip
cpython-0f0599ddc1ad02f392fe0be58479f34c57a80c8d.tar.gz
cpython-0f0599ddc1ad02f392fe0be58479f34c57a80c8d.tar.bz2
When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fields
to floats.
Diffstat (limited to 'Lib')
-rw-r--r--Lib/test/test_csv.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index ed10ed7..d458332 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -241,6 +241,12 @@ class Test_Csv(unittest.TestCase):
quotechar=None, escapechar='\\')
self._read_test(['1,",3,",5'], [['1', '"', '3', '"', '5']],
quoting=csv.QUOTE_NONE, escapechar='\\')
+ # will this fail where locale uses comma for decimals?
+ self._read_test([',3,"5",7.3'], [['', 3, '5', 7.3]],
+ quoting=csv.QUOTE_NONNUMERIC)
+ self.assertRaises(ValueError, self._read_test,
+ ['abc,3'], [[]],
+ quoting=csv.QUOTE_NONNUMERIC)
def test_read_bigfield(self):
# This exercises the buffer realloc functionality and field size