Skip to content

Commit e44e9df

Browse files
Replace name and age with letter and offset
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
1 parent 9d6d36f commit e44e9df

File tree

1 file changed

+8
-49
lines changed

1 file changed

+8
-49
lines changed

Lib/test/test_csv.py

Lines changed: 8 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1364,55 +1364,14 @@ class TestSniffer(unittest.TestCase):
13641364
sample15 = "\n\n\n"
13651365
sample16 = "abc\ndef\nghi"
13661366

1367-
sample17 = """\
1368-
name,age
1369-
Alice,30
1370-
Bob,40
1371-
Carol,50
1372-
Dave,60
1373-
Eve,70
1374-
Frank,80
1375-
Grace,90
1376-
Heidi,100
1377-
Ivan,110
1378-
Judy,120
1379-
Karl,130
1380-
Liam,140
1381-
Mallory,150
1382-
Niaj,160
1383-
Olivia,170
1384-
Peggy,180
1385-
Quinn,190
1386-
Rupert,200
1387-
Sybil,210
1388-
Trent,220
1389-
Victor,not_a_number
1390-
"""
1391-
sample18 = """\
1392-
name,age
1393-
Alice,30
1394-
Bob,40
1395-
Carol,50
1396-
Dave,60
1397-
Eve,70
1398-
Frank,80
1399-
Grace,90
1400-
Heidi,100
1401-
Ivan,110
1402-
Judy,120
1403-
Karl,130
1404-
Liam,140
1405-
Mallory,150
1406-
Niaj,160
1407-
Olivia,170
1408-
Peggy,180
1409-
Quinn,190
1410-
Rupert,200
1411-
Sybil,210
1412-
Trent,220
1413-
Uma,230
1414-
Victor,not_a_number
1415-
"""
1367+
sample17 = ["letter,offset"]
1368+
sample17.extend(f"{chr(ord('a') + i)},{i}" for i in range(20))
1369+
sample17.append("v,twenty_one")
1370+
sample17 = '\n'.join(sample17)
1371+
sample18 = ["letter,offset"]
1372+
sample18.extend(f"{chr(ord('a') + i)},{i}" for i in range(21))
1373+
sample18.append("v,twenty_one")
1374+
sample18 = '\n'.join(sample18)
14161375

14171376
def test_issue43625(self):
14181377
sniffer = csv.Sniffer()

0 commit comments

Comments
 (0)