MCPcopy Index your code
hub / github.com/python/cpython / test_zero_mode_tie_order_independence

Method test_zero_mode_tie_order_independence

Lib/test/test_csv.py:1491–1507  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1489 self.assertNotEqual(sniffer.sniff(sample).delimiter, "\r")
1490
1491 def test_zero_mode_tie_order_independence(self):
1492 sniffer = csv.Sniffer()
1493 # ":" appears in half the rows (1, 0, 1, 0) - a tie between
1494 # 0 and 1 per line.
1495 # "," appears once every row (true delimiter).
1496 #
1497 # Even if the zero-frequency bucket is appended vs. inserted, the tie
1498 # yields an adjusted score of 0, so ":" should not be promoted and
1499 # "," must be selected.
1500 sample = (
1501 "a,b:c\n"
1502 "d,e\n"
1503 "f,g:c\n"
1504 "h,i\n"
1505 )
1506 dialect = sniffer.sniff(sample)
1507 self.assertEqual(dialect.delimiter, ",")
1508
1509 def test_zero_mode_tie_order_comma_first(self):
1510 sniffer = csv.Sniffer()

Callers

nothing calls this directly

Calls 2

sniffMethod · 0.95
assertEqualMethod · 0.45

Tested by

no test coverage detected