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

Test invalid quoting constant

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
This commit is contained in:
Tomas R 2024-10-03 10:14:57 +02:00 committed by GitHub
parent c066bf5535
commit 656b7a3c83
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 0 deletions

View File

@ -1103,6 +1103,12 @@ class TestDialectValidity(unittest.TestCase):
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 = '"'