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

Method test_newline

Lib/test/test_bz2.py:1201–1207  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

1199 self.assertEqual(f.read(), "foobar")
1200
1201 def test_newline(self):
1202 # Test with explicit newline (universal newline mode disabled).
1203 text = self.TEXT.decode("ascii")
1204 with self.open(self.filename, "wt", encoding="utf-8", newline="\n") as f:
1205 f.write(text)
1206 with self.open(self.filename, "rt", encoding="utf-8", newline="\r") as f:
1207 self.assertEqual(f.readlines(), [text])
1208
1209
1210def tearDownModule():

Callers

nothing calls this directly

Calls 5

openMethod · 0.95
decodeMethod · 0.45
writeMethod · 0.45
assertEqualMethod · 0.45
readlinesMethod · 0.45

Tested by

no test coverage detected