Author: Antonio Cuni <[email protected]>
Branch: py3k
Changeset: r52995:0132be21e554
Date: 2012-02-28 18:38 +0100
http://bitbucket.org/pypy/pypy/changeset/0132be21e554/
Log: test bytes literals instead of unicode, and make sure to write bytes
to a file opened with 'wb'
diff --git a/pypy/module/marshal/test/test_marshal.py
b/pypy/module/marshal/test/test_marshal.py
--- a/pypy/module/marshal/test/test_marshal.py
+++ b/pypy/module/marshal/test/test_marshal.py
@@ -120,8 +120,8 @@
case = scopefunc.__code__
self.marshal_check(case)
- def test_u_quote_hello_quote_(self):
- case = u'hello'
+ def test_b_quote_hello_quote_(self):
+ case = b'hello'
self.marshal_check(case)
def test_set_brace__ecarb_(self):
@@ -149,7 +149,7 @@
f = open(self.tmpfile, 'wb')
marshal.dump(obj1, f)
marshal.dump(obj2, f)
- f.write('END')
+ f.write(b'END')
f.close()
f = open(self.tmpfile, 'rb')
obj1b = marshal.load(f)
@@ -158,7 +158,7 @@
f.close()
assert obj1b == obj1
assert obj2b == obj2
- assert tail == 'END'
+ assert tail == b'END'
def test_unicode(self):
import marshal, sys
_______________________________________________
pypy-commit mailing list
[email protected]
http://mail.python.org/mailman/listinfo/pypy-commit