Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(90991)

Unified Diff: Lib/test/test_mmap.py

Issue 26335: Make mmap.write return the number of bytes written like other write methods
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
index 0f25742..4851f8c 100644
--- a/Lib/test/test_mmap.py
+++ b/Lib/test/test_mmap.py
@@ -32,9 +32,9 @@ class MmapTests(unittest.TestCase):
f = open(TESTFN, 'bw+')
try:
# Write 2 pages worth of data to the file
- f.write(b'\0'* PAGESIZE)
- f.write(b'foo')
- f.write(b'\0'* (PAGESIZE-3) )
+ self.assertEqual(f.write(b'\0'* PAGESIZE), PAGESIZE)
berkerpeksag 2016/02/23 00:57:52 I'd prefer to keep existed tests as they are and a
+ self.assertEqual(f.write(b'foo'), 3)
+ self.assertEqual(f.write(b'\0'* (PAGESIZE-3) ), PAGESIZE - 3)
f.flush()
m = mmap.mmap(f.fileno(), 2 * PAGESIZE)
finally:

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+