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

Method test_space_dialect

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

Source from the content-addressed store, hash-verified

624 self.assertRaises(csv.Error, myexceltsv)
625
626 def test_space_dialect(self):
627 class space(csv.excel):
628 delimiter = " "
629 quoting = csv.QUOTE_NONE
630 escapechar = "\\"
631
632 with TemporaryFile("w+", encoding="utf-8") as fileobj:
633 fileobj.write("abc def\nc1ccccc1 benzene\n")
634 fileobj.seek(0)
635 reader = csv.reader(fileobj, dialect=space())
636 self.assertEqual(next(reader), ["abc", "", "", "def"])
637 self.assertEqual(next(reader), ["c1ccccc1", "benzene"])
638
639 def compare_dialect_123(self, expected, *writeargs, **kwwriteargs):
640

Callers

nothing calls this directly

Calls 6

TemporaryFileFunction · 0.90
spaceClass · 0.85
writeMethod · 0.45
seekMethod · 0.45
readerMethod · 0.45
assertEqualMethod · 0.45

Tested by

no test coverage detected