[pypy-commit] pypy py3k: fix this test to pass with -A. Still broken on pypy

antocuni noreply at buildbot.pypy.org
Fri Feb 24 20:13:29 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52874:041810e6563a
Date: 2012-02-24 16:23 +0100
http://bitbucket.org/pypy/pypy/changeset/041810e6563a/

Log:	fix this test to pass with -A. Still broken on pypy

diff --git a/pypy/module/__builtin__/test/test_builtin.py b/pypy/module/__builtin__/test/test_builtin.py
--- a/pypy/module/__builtin__/test/test_builtin.py
+++ b/pypy/module/__builtin__/test/test_builtin.py
@@ -590,11 +590,11 @@
         assert hasattr(x, '__class__') is True
         assert hasattr(x, 'foo') is True
         assert hasattr(x, 'bar') is False
-        assert hasattr(x, 'abc') is False    # CPython compliance
-        assert hasattr(x, 'bac') is False    # CPython compliance
+        raises(TypeError, "hasattr(x, 'abc')")
+        raises(TypeError, "hasattr(x, 'bac')")
         raises(TypeError, hasattr, x, None)
         raises(TypeError, hasattr, x, 42)
-        raises(UnicodeError, hasattr, x, u'\u5678')  # cannot encode attr name
+        assert hasattr(x, '\u5678') is False
 
     def test_compile_leading_newlines(self):
         src = """


More information about the pypy-commit mailing list