[pypy-commit] pypy s390x-backend: unicode endian test issue in pypy module
plan_rich
pypy.commits at gmail.com
Fri Jan 22 02:37:00 EST 2016
Author: Richard Plangger <planrichi at gmail.com>
Branch: s390x-backend
Changeset: r81900:d2af83605cf2
Date: 2016-01-22 08:36 +0100
http://bitbucket.org/pypy/pypy/changeset/d2af83605cf2/
Log: unicode endian test issue in pypy module
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
@@ -389,6 +389,7 @@
def test_writelines(self):
import array
+ import sys
fn = self.temptestfile
with file(fn, 'w') as f:
f.writelines(['abc'])
@@ -406,7 +407,10 @@
exc = raises(TypeError, f.writelines, [memoryview('jkl')])
assert str(exc.value) == "writelines() argument must be a sequence of strings"
out = open(fn, 'rb').readlines()[0]
- assert out[0:5] == 'abcd\x00'
+ if sys.byteorder == 'big':
+ assert out[0:7] == 'abc\x00\x00\x00d'
+ else:
+ assert out[0:5] == 'abcd\x00'
assert out[-3:] == 'ghi'
with file(fn, 'wb') as f:
More information about the pypy-commit
mailing list