Author: Armin Rigo <[email protected]>
Branch: py3.5
Changeset: r89470:783976b8ae44
Date: 2017-01-10 12:17 +0100
http://bitbucket.org/pypy/pypy/changeset/783976b8ae44/
Log: fix test
diff --git a/pypy/module/_io/test/test_fileio.py
b/pypy/module/_io/test/test_fileio.py
--- a/pypy/module/_io/test/test_fileio.py
+++ b/pypy/module/_io/test/test_fileio.py
@@ -155,10 +155,17 @@
f.seek(0)
m = memoryview(bytearray(b"helloworld"))
assert f.readinto(m) == 10
+ #
exc = raises(TypeError, f.readinto, u"hello")
- assert str(exc.value) == "must be read-write buffer, not str"
+ msg = str(exc.value)
+ print(msg)
+ assert " read-write b" in msg and msg.endswith(", not str")
+ #
exc = raises(TypeError, f.readinto, memoryview(b"hello"))
- assert str(exc.value) == "must be read-write buffer, not memoryview"
+ msg = str(exc.value)
+ print(msg)
+ assert " read-write b" in msg and msg.endswith(", not memoryview")
+ #
f.close()
assert a == b'a\nb\nc\0\0\0\0\0'
#
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit