Author: Ronan Lamy <[email protected]>
Branch: py3.5
Changeset: r93832:5e9a14e1be53
Date: 2018-02-19 19:33 +0000
http://bitbucket.org/pypy/pypy/changeset/5e9a14e1be53/
Log: fix test
diff --git a/pypy/module/cpyext/test/test_longobject.py
b/pypy/module/cpyext/test/test_longobject.py
--- a/pypy/module/cpyext/test/test_longobject.py
+++ b/pypy/module/cpyext/test/test_longobject.py
@@ -277,23 +277,23 @@
free(bytes);
return NULL;
}
- result = PyString_FromStringAndSize((const char *)bytes, n);
+ result = PyBytes_FromStringAndSize((const char *)bytes, n);
free(bytes);
return result;
"""),
])
s = module.as_bytearray(0x41BC9A, 4, True, False)
- assert s == "\x9A\xBC\x41\x00"
+ assert s == b"\x9A\xBC\x41\x00"
s = module.as_bytearray(0x41BC9A, 4, False, False)
- assert s == "\x00\x41\xBC\x9A"
+ assert s == b"\x00\x41\xBC\x9A"
s = module.as_bytearray(0x41BC9A, 3, True, False)
- assert s == "\x9A\xBC\x41"
+ assert s == b"\x9A\xBC\x41"
s = module.as_bytearray(0x41BC9A, 3, True, True)
- assert s == "\x9A\xBC\x41"
+ assert s == b"\x9A\xBC\x41"
s = module.as_bytearray(0x9876, 2, True, False)
- assert s == "\x76\x98"
+ assert s == b"\x76\x98"
s = module.as_bytearray(0x9876 - 0x10000, 2, True, True)
- assert s == "\x76\x98"
+ assert s == b"\x76\x98"
raises(OverflowError, module.as_bytearray,
0x9876, 2, False, True)
raises(OverflowError, module.as_bytearray,
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit