We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8b1e0db commit 7a8dd6fCopy full SHA for 7a8dd6f
1 file changed
Lib/test/test_pathlib/test_write.py
@@ -65,14 +65,12 @@ def test_open_wb(self):
65
66
def test_write_bytes(self):
67
p = self.root / 'fileA'
68
- p.write_bytes(b'abcdefg')
69
- self.assertEqual(self.ground.readbytes(p), b'abcdefg')
+ data = b'abcdefg'
+ self.assertEqual(len(data), p.write_bytes(data))
70
+ self.assertEqual(self.ground.readbytes(p), data)
71
# Check that trying to write str does not truncate the file.
72
self.assertRaises(TypeError, p.write_bytes, 'somestr')
73
- # check the return value
74
- data = b'some bytes'
75
- self.assertEqual(len(data), p.write_bytes(data))
76
77
def test_write_text(self):
78
0 commit comments