Commits

Antonio Cuni committed 70609ab

(antocuni, arigo) in-progress, write a test for 2e5dc4da5631

Comments (0)

Files changed (2)

pypy/module/pypyjit/test_pypy_c/model.py

 
     def format_ops(self, id=None, **kwds):
         if id is None:
-            ops = self.allops()
+            ops = self.allops(**kwds)
         else:
             ops = self.ops_by_id(id, **kwds)
         return '\n'.join(map(str, ops))

pypy/module/pypyjit/test_pypy_c/test_pypy_c_new.py

             guard_isnull(p16, descr=<Guard6>)
         """)
 
+    def test_import_fast_path(self, tmpdir):
+        py.test.skip('in-progress')
+        pkg = tmpdir.join('mypkg').ensure(dir=True)
+        pkg.join('__init__.py').write("")
+        pkg.join('mod.py').write(str(py.code.Source("""
+            def do_the_import():
+                import sys
+        """)))
+        def main(path, n):
+            import sys
+            sys.path.append(path)
+            from mypkg.mod import do_the_import
+            for i in range(n):
+                do_the_import()
+        #
+        log = self.run(main, [str(tmpdir), 300], threshold=200)
+        loop, = log.loops_by_filename(self.filepath)
+        # XXX: check the loop
+
     def test_arraycopy_disappears(self):
         def main(n):
             i = 0