https://github.com/python/cpython/commit/ff0ab0eb3f8106f3ff757834068d05e6cee72cc8
commit: ff0ab0eb3f8106f3ff757834068d05e6cee72cc8
branch: 3.13
author: Miss Islington (bot) <[email protected]>
committer: Yhg1s <[email protected]>
date: 2024-10-03T09:27:28-07:00
summary:

[3.13] gh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. 
(GH-121983) (#124926)

gh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. 
(GH-121983)

Test invalid quoting constant

(cherry picked from commit 656b7a3c83c79f99beac950b59c47575562ea729)

Co-authored-by: Tomas R <[email protected]>
Co-authored-by: Kirill Podoprigora <[email protected]>

files:
M Lib/test/test_csv.py

diff --git a/Lib/test/test_csv.py b/Lib/test/test_csv.py
index c718ee1203cbe0..ce5c03659f1979 100644
--- a/Lib/test/test_csv.py
+++ b/Lib/test/test_csv.py
@@ -1103,6 +1103,12 @@ class mydialect(csv.Dialect):
         mydialect.quoting = None
         self.assertRaises(csv.Error, mydialect)
 
+        mydialect.quoting = 42
+        with self.assertRaises(csv.Error) as cm:
+            mydialect()
+        self.assertEqual(str(cm.exception),
+                         'bad "quoting" value')
+
         mydialect.doublequote = True
         mydialect.quoting = csv.QUOTE_ALL
         mydialect.quotechar = '"'

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3/lists/python-checkins.python.org/
Member address: [email protected]

Reply via email to