summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_csv.py
diff options
context:
space:
mode:
authorAndrew McNamara <andrewm@object-craft.com.au>2005-01-11 02:18:36 (GMT)
committerAndrew McNamara <andrewm@object-craft.com.au>2005-01-11 02:18:36 (GMT)
commit8c94b42f31515ca6b552cb427aea0cd446098dd9 (patch)
tree949203c2afb74e80f46dc9124cfee0401c64c0d0 /Lib/test/test_csv.py
parent86625972a1e330e200a3ae34f414a6caf12c6502 (diff)
downloadcpython-8c94b42f31515ca6b552cb427aea0cd446098dd9.zip
cpython-8c94b42f31515ca6b552cb427aea0cd446098dd9.tar.gz
cpython-8c94b42f31515ca6b552cb427aea0cd446098dd9.tar.bz2
No longer attempt to instantiate python classes describing dialects. This
was done because we were previously performing validation of the dialect from python, but this is now down within the C module. Also, the method we were using to detect classes did not work with new-style classes.
Diffstat (limited to 'Lib/test/test_csv.py')
-rw-r--r--Lib/test/test_csv.py18
1 files changed, 0 insertions, 18 deletions
diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index cdda179..34177cc 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -24,25 +24,12 @@ class Test_Csv(unittest.TestCase):
self.assertRaises(TypeError, ctor, arg, delimiter = 0)
self.assertRaises(TypeError, ctor, arg, delimiter = 'XX')
self.assertRaises(csv.Error, ctor, arg, 'foo')
- self.assertRaises(TypeError, ctor, arg, None)
self.assertRaises(TypeError, ctor, arg, delimiter=None)
self.assertRaises(TypeError, ctor, arg, delimiter=1)
self.assertRaises(TypeError, ctor, arg, quotechar=1)
self.assertRaises(TypeError, ctor, arg, lineterminator=None)
self.assertRaises(TypeError, ctor, arg, lineterminator=1)
self.assertRaises(TypeError, ctor, arg, quoting=None)
-# We now allow this, only raising an exception if quoting is needed.
-# self.assertRaises(TypeError, ctor, arg, quotechar=None)
-# self.assertRaises(TypeError, ctor, arg,
-# quoting=csv.QUOTE_NONE, escapechar=None)
-# No longer complains about dialects with invalid attributes [AM]
-# class BadDialect:
-# bad_attr = 0
-# self.assertRaises(AttributeError, csv.reader, [], BadDialect)
- class BadClass:
- def __init__(self):
- raise IOError
- self.assertRaises(IOError, csv.reader, [], BadClass)
def test_reader_arg_valid(self):
self._test_arg_valid(csv.reader, [])
@@ -258,11 +245,6 @@ class TestDialectRegistry(unittest.TestCase):
self.assertRaises(csv.Error, csv.unregister_dialect, "nonesuch")
self.assertRaises(TypeError, csv.register_dialect, None)
self.assertRaises(TypeError, csv.register_dialect, None, None)
- self.assertRaises(TypeError, csv.register_dialect, "nonesuch", None)
- class bogus:
- def __init__(self):
- raise KeyError
- self.assertRaises(KeyError, csv.register_dialect, "nonesuch", bogus)
def test_registry(self):
class myexceltsv(csv.excel):