Skip to content

Commit

Permalink
pythongh-121982: csv: Add a test case for invalid quoting con…
Browse files Browse the repository at this point in the history
…stant. (python#121983)

Test invalid quoting constant

Co-authored-by: Kirill Podoprigora <[email protected]>
  • Loading branch information
tomasr8 and Eclips4 authored Oct 3, 2024
1 parent c066bf5 commit 656b7a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Lib/test/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = '"'
Expand Down

0 comments on commit 656b7a3

Please sign in to comment.