From 656b7a3c83c79f99beac950b59c47575562ea729 Mon Sep 17 00:00:00 2001 From: Tomas R Date: Thu, 3 Oct 2024 10:14:57 +0200 Subject: [PATCH] gh-121982: ``csv``: Add a test case for invalid ``quoting`` constant. (#121983) Test invalid quoting constant Co-authored-by: Kirill Podoprigora --- Lib/test/test_csv.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 = '"'