[Python-checkins] python/dist/src/Lib/test test_csv.py,1.17,1.18

andrewmcnamara at users.sourceforge.net andrewmcnamara at users.sourceforge.net
Tue Jan 11 03:18:39 CET 2005


Update of /cvsroot/python/python/dist/src/Lib/test
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25624/Lib/test

Modified Files:
	test_csv.py 
Log Message:
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.


Index: test_csv.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/test/test_csv.py,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- test_csv.py	11 Jan 2005 01:28:33 -0000	1.17
+++ test_csv.py	11 Jan 2005 02:18:36 -0000	1.18
@@ -24,25 +24,12 @@
         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 @@
         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):



More information about the Python-checkins mailing list