[pypy-svn] r34563 - pypy/dist/pypy/module/__builtin__/test

pedronis at codespeak.net pedronis at codespeak.net
Mon Nov 13 15:32:45 CET 2006


Author: pedronis
Date: Mon Nov 13 15:32:43 2006
New Revision: 34563

Modified:
   pypy/dist/pypy/module/__builtin__/test/test_import.py
   pypy/dist/pypy/module/__builtin__/test/test_special.py
Log:
make module/__builtin__ tests behave when run with pypy-c py.test -A



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	Mon Nov 13 15:32:43 2006
@@ -9,6 +9,8 @@
 
 from pypy.module.__builtin__ import importing
 
+from pypy import conftest
+
 def setuppkg(pkgname, **entries):
     p = udir.join('impsubdir')
     if pkgname:
@@ -56,19 +58,22 @@
 
     # create compiled/x.py and a corresponding pyc file
     p = setuppkg("compiled", x = "x = 84")
-    w = space.wrap
-    w_modname = w("compiled.x")
-    filename = str(p.join("x.py"))
-    fd = os.open(filename, os.O_RDONLY, 0666)
-    osfile = importing.OsFileWrapper(fd)
-    try:
-        importing.load_source_module(space,
-                                     w_modname,
-                                     w(importing.Module(space, w_modname)),
-                                     filename,
-                                     osfile)
-    finally:
-        osfile.close()
+    if conftest.option.runappdirect:
+        pass
+    else:
+        w = space.wrap
+        w_modname = w("compiled.x")
+        filename = str(p.join("x.py"))
+        fd = os.open(filename, os.O_RDONLY, 0666)
+        osfile = importing.OsFileWrapper(fd)
+        try:
+            importing.load_source_module(space,
+                                         w_modname,
+                                         w(importing.Module(space, w_modname)),
+                                         filename,
+                                         osfile)
+        finally:
+            osfile.close()
 
     return str(root)
 

Modified: pypy/dist/pypy/module/__builtin__/test/test_special.py
==============================================================================
--- pypy/dist/pypy/module/__builtin__/test/test_special.py	(original)
+++ pypy/dist/pypy/module/__builtin__/test/test_special.py	Mon Nov 13 15:32:43 2006
@@ -1,5 +1,11 @@
 import py 
 
+from pypy import conftest
+
+def setup_module(mod):
+    if conftest.option.runappdirect:
+        py.test.skip("doesn't make sense with -A")
+
 def app_test__isfake(): 
     assert not _isfake(map) 
     assert not _isfake(object) 



More information about the Pypy-commit mailing list