Skip to content

Commit c62c513

Browse files
committed
gh-109638: Test literal quotes in unquoted fields
1 parent 1705351 commit c62c513

1 file changed

Lines changed: 10 additions & 5 deletions

File tree

Lib/test/test_csv.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,11 +1589,16 @@ def test_doublequote_across_quoted_fields(self):
15891589
sniffer.sniff(data).doublequote,
15901590
False,
15911591
)
1592-
self.assertFalse(sniffer._detect_doublequote(
1593-
f'a{quotechar}b{separator}{data}',
1594-
delimiter,
1595-
quotechar,
1596-
))
1592+
for literal_quote_count in range(1, 5):
1593+
with self.subTest(
1594+
literal_quote_count=literal_quote_count,
1595+
):
1596+
self.assertFalse(sniffer._detect_doublequote(
1597+
f'a{quotechar * literal_quote_count}b'
1598+
f'{separator}{data}',
1599+
delimiter,
1600+
quotechar,
1601+
))
15971602

15981603
def test_guess_delimiter_crlf_not_chosen(self):
15991604
# Ensure that we pick the real delimiter ("|") over "\r" in a tie.

0 commit comments

Comments
 (0)