[pypy-svn] r15187 - in pypy/dist/pypy/module/__builtin__/test: . impsubdir/compiled

rxe at codespeak.net rxe at codespeak.net
Wed Jul 27 14:50:35 CEST 2005


Author: rxe
Date: Wed Jul 27 14:50:33 2005
New Revision: 15187

Added:
   pypy/dist/pypy/module/__builtin__/test/impsubdir/compiled/x.pyc   (contents, props changed)
Modified:
   pypy/dist/pypy/module/__builtin__/test/test_import.py
Log:
All tests pass!



Added: pypy/dist/pypy/module/__builtin__/test/impsubdir/compiled/x.pyc
==============================================================================
Binary file. No diff available.

Modified: pypy/dist/pypy/module/__builtin__/test/test_import.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/test_import.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/test_import.py	Wed Jul 27 14:50:33 2005
@@ -9,28 +9,13 @@
 
 from pypy.module.__builtin__ import importing
 
-
-def compile_pyfile(space, pathname):
-    import time
-    fd = os.open(pathname, importing.BIN_READMASK, 0777)
-    osfile = OsFileWrapper(fd)
-    w_ret = importing.parse_source_module(space,
-                                          pathname,
-                                          osfile)        
-    osfile.close()
-    pycode = space.interpclass_w(w_ret)
-    assert type(pycode) is pypy.interpreter.pycode.PyCode
-
-    importing.write_compiled_module(space,
-                                    pycode,
-                                    pathname + "c",
-                                    int(time.time()))
+def get_import_path():
+    j = os.path.join
+    p = os.path.abspath(j(os.path.dirname(__file__), 'impsubdir'))
+    return p
 
 def _setup(space):
-    j = os.path.join
-    dn = os.path.abspath(j(os.path.dirname(__file__), 'impsubdir'))
-    compile_pyfile(space, j(j(dn, "compiled"), "x.py"))
-    
+    dn = get_import_path()
     return space.appexec([space.wrap(dn)], """
         (dn): 
             import sys
@@ -181,7 +166,7 @@
             import pkg.pkg2.b
         raises(ImportError,imp_b)
 
-    def Xtest_pyc(self):
+    def test_pyc(self):
         import sys
         import compiled.x
         assert compiled.x == sys.modules.get('compiled.x')



More information about the Pypy-commit mailing list