[pypy-commit] pypy py3k: these two tests were really meant to be run against itertools, because it's a

antocuni noreply at buildbot.pypy.org
Mon Feb 27 17:00:27 CET 2012


Author: Antonio Cuni <anto.cuni at gmail.com>
Branch: py3k
Changeset: r52935:aca4ff218220
Date: 2012-02-27 14:51 +0100
http://bitbucket.org/pypy/pypy/changeset/aca4ff218220/

Log:	these two tests were really meant to be run against itertools,
	because it's a builtin module. It seems that a20df1bb1bb8 did a
	s/itertools/queue, but I can't see why. Revert it.

diff --git a/pypy/module/imp/test/test_import.py b/pypy/module/imp/test/test_import.py
--- a/pypy/module/imp/test/test_import.py
+++ b/pypy/module/imp/test/test_import.py
@@ -38,7 +38,7 @@
                     test_reload = "def test():\n    raise ValueError\n",
                     infinite_reload = "import infinite_reload; reload(infinite_reload)",
                     del_sys_module = "import sys\ndel sys.modules['del_sys_module']\n",
-                    queue = "hello_world = 42\n",
+                    itertools = "hello_world = 42\n",
                     gc = "should_never_be_seen = 42\n",
                     )
     root.ensure("notapackage", dir=1)    # empty, no __init__.py
@@ -151,7 +151,7 @@
 class AppTestImport:
 
     def setup_class(cls): # interpreter-level
-        #cls.space = gettestobjspace(usemodules=['itertools'])
+        cls.space = gettestobjspace(usemodules=['itertools'])
         cls.w_runappdirect = cls.space.wrap(conftest.option.runappdirect)
         cls.saved_modules = _setup(cls.space)
         #XXX Compile class
@@ -606,32 +606,32 @@
 
     def test_shadow_extension_1(self):
         if self.runappdirect: skip("hard to test: module is already imported")
-        # 'import queue' is supposed to find queue.py if there is
+        # 'import itertools' is supposed to find itertools.py if there is
         # one in sys.path.
         import sys
-        assert 'queue' not in sys.modules
-        import queue
-        assert hasattr(queue, 'hello_world')
-        assert not hasattr(queue, 'count')
-        assert '(built-in)' not in repr(queue)
-        del sys.modules['queue']
+        assert 'itertools' not in sys.modules
+        import itertools
+        assert hasattr(itertools, 'hello_world')
+        assert not hasattr(itertools, 'count')
+        assert '(built-in)' not in repr(itertools)
+        del sys.modules['itertools']
 
     def test_shadow_extension_2(self):
         if self.runappdirect: skip("hard to test: module is already imported")
-        # 'import queue' is supposed to find the built-in module even
+        # 'import itertools' is supposed to find the built-in module even
         # if there is also one in sys.path as long as it is *after* the
         # special entry '.../lib_pypy/__extensions__'.
         import sys
-        assert 'queue' not in sys.modules
+        assert 'itertools' not in sys.modules
         sys.path.append(sys.path.pop(0))
         try:
-            import queue
-            assert not hasattr(queue, 'hello_world')
-            assert hasattr(queue, 'izip')
-            assert '(built-in)' in repr(queue)
+            import itertools
+            assert not hasattr(itertools, 'hello_world')
+            assert hasattr(itertools, 'izip')
+            assert '(built-in)' in repr(itertools)
         finally:
             sys.path.insert(0, sys.path.pop())
-        del sys.modules['queue']
+        del sys.modules['itertools']
 
 
 class TestAbi:


More information about the pypy-commit mailing list