Author: Armin Rigo <[email protected]>
Branch:
Changeset: r95091:6e1de6dbe769
Date: 2018-09-11 15:36 +0200
http://bitbucket.org/pypy/pypy/changeset/6e1de6dbe769/
Log: two completely corner cases where we differ from CPython
diff --git a/pypy/objspace/std/test/test_unicodeobject.py
b/pypy/objspace/std/test/test_unicodeobject.py
--- a/pypy/objspace/std/test/test_unicodeobject.py
+++ b/pypy/objspace/std/test/test_unicodeobject.py
@@ -1163,7 +1163,12 @@
assert type(unicode(z)) is unicode
assert unicode(z) == u'foobaz'
#
- e = raises(TypeError, unicode, u'text', 'supposedly_the_encoding')
+ # two completely corner cases where we differ from CPython:
+ #assert unicode(encoding='supposedly_the_encoding') == u''
+ #assert unicode(errors='supposedly_the_error') == u''
+ e = raises(TypeError, unicode, u'', 'supposedly_the_encoding')
+ assert str(e.value) == 'decoding Unicode is not supported'
+ e = raises(TypeError, unicode, u'', errors='supposedly_the_error')
assert str(e.value) == 'decoding Unicode is not supported'
e = raises(TypeError, unicode, u, 'supposedly_the_encoding')
assert str(e.value) == 'decoding Unicode is not supported'
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit