[pypy-commit] pypy py3k: the semantics of this particular case changed in python3. Adapt the test, it passes out of the box

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


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52870:460767db1dce
Date: 2012-02-24 15:41 +0100
http://bitbucket.org/pypy/pypy/changeset/460767db1dce/

Log:	the semantics of this particular case changed in python3. Adapt the
	test, it passes out of the box

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
@@ -131,8 +131,9 @@
             def __getitem__(self, item):
                 raise KeyError(item)
             def keys(self):
-                return 'a'    # not a list!
-        raises(TypeError, eval, "dir()", {}, C())
+                return 'abcd'    # not a list!
+        names = eval("dir()", {}, C())
+        assert names == ['a', 'b', 'c', 'd']
 
     def test_dir_broken_module(self):
         import types


More information about the pypy-commit mailing list