Author: Brian Kearns <[email protected]>
Branch: use-file-star-for-file
Changeset: r73497:369b70435fcb
Date: 2014-09-11 19:25 -0700
http://bitbucket.org/pypy/pypy/changeset/369b70435fcb/
Log: fix this test on win32
diff --git a/pypy/module/_file/test/test_file_extra.py
b/pypy/module/_file/test/test_file_extra.py
--- a/pypy/module/_file/test/test_file_extra.py
+++ b/pypy/module/_file/test/test_file_extra.py
@@ -503,24 +503,26 @@
f.close()
def test_flush(self):
- import os
+ import os, sys
fn = self.temptestfile
f = file(fn, 'w', 0)
f.write('x')
assert os.stat(fn).st_size == 1
f.close()
- f = file(fn, 'wb', 1)
- f.write('x')
- assert os.stat(fn).st_size == 0
- f.write('\n')
- assert os.stat(fn).st_size == 2
- f.write('x')
- assert os.stat(fn).st_size == 2
- f.flush()
- assert os.stat(fn).st_size == 3
- f.close()
- assert os.stat(fn).st_size == 3
+ # http://msdn.microsoft.com/en-us/library/86cebhfs.aspx
+ if sys.platform != 'win32':
+ f = file(fn, 'wb', 1)
+ f.write('x')
+ assert os.stat(fn).st_size == 0
+ f.write('\n')
+ assert os.stat(fn).st_size == 2
+ f.write('x')
+ assert os.stat(fn).st_size == 2
+ f.flush()
+ assert os.stat(fn).st_size == 3
+ f.close()
+ assert os.stat(fn).st_size == 3
f = file(fn, 'wb', 1000)
f.write('x')
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit