[pypy-commit] pypy stdlib-unification: reenable the ability to run stdlib tests

RonnyPfannschmidt noreply at buildbot.pypy.org
Fri Apr 13 22:03:23 CEST 2012


Author: Ronny Pfannschmidt <Ronny.Pfannschmidt at gmx.de>
Branch: stdlib-unification
Changeset: r54343:f8735b33c95a
Date: 2012-04-13 21:51 +0200
http://bitbucket.org/pypy/pypy/changeset/f8735b33c95a/

Log:	reenable the ability to run stdlib tests

diff --git a/lib-python/conftest.py b/lib-python/conftest.py
--- a/lib-python/conftest.py
+++ b/lib-python/conftest.py
@@ -17,8 +17,7 @@
 from pypy.conftest import gettestobjspace, option as pypy_option 
 
 from pypy.tool.pytest import appsupport 
-from pypy.tool.pytest.confpath import pypydir, libpythondir, \
-                                      regrtestdir, modregrtestdir, testresultdir
+from pypy.tool.pytest.confpath import pypydir, testdir, testresultdir
 
 pytest_plugins = "resultlog",
 rsyncdirs = ['.', '../pypy/']
@@ -76,14 +75,11 @@
     compiler = property(compiler)
 
     def ismodified(self): 
-        return modregrtestdir.join(self.basename).check() 
+        #XXX: ask hg
+        return None
 
     def getfspath(self): 
-        fn = modregrtestdir.join(self.basename)
-        if fn.check(): 
-            return fn 
-        fn = regrtestdir.join(self.basename)
-        return fn 
+        return testdir.join(self.basename)
 
     def run_file(self, space): 
         fspath = self.getfspath()
@@ -526,7 +522,7 @@
     listed_names = dict.fromkeys([regrtest.basename for regrtest in testmap])
     listed_names['test_support.py'] = True     # ignore this
     missing = []
-    for path in regrtestdir.listdir(fil='test_*.py'):
+    for path in testdir.listdir(fil='test_*.py'):
         name = path.basename
         if name not in listed_names:
             missing.append('    RegrTest(%r),' % (name,))
@@ -547,7 +543,7 @@
     regrtest = parent.config._basename2spec.get(path.basename, None)
     if regrtest is None:
         return
-    if path.dirpath() not in (modregrtestdir, regrtestdir):
+    if path.dirpath() != testdir:
         return
     return RunFileExternal(path.basename, parent=parent, regrtest=regrtest)
 
@@ -715,14 +711,3 @@
             lst.append('core')
         return lst
 
-#
-# Sanity check  (could be done more nicely too)
-#
-import os
-samefile = getattr(os.path, 'samefile', 
-                   lambda x,y : str(x) == str(y))
-if samefile(os.getcwd(), str(regrtestdir.dirpath())):
-    raise NotImplementedError(
-        "Cannot run py.test with this current directory:\n"
-        "the app-level sys.path will contain %s before %s)." % (
-            regrtestdir.dirpath(), modregrtestdir.dirpath()))
diff --git a/pypy/tool/pytest/confpath.py b/pypy/tool/pytest/confpath.py
--- a/pypy/tool/pytest/confpath.py
+++ b/pypy/tool/pytest/confpath.py
@@ -7,6 +7,4 @@
 distdir = pypydir.dirpath()
 testresultdir = distdir.join('testresult') 
 assert pypydir.check(dir=1) 
-libpythondir = lib_pypy.LIB_PYTHON
-regrtestdir = lib_pypy.LIB_PYTHON_VANILLA.join('test') 
-modregrtestdir = lib_pypy.LIB_PYTHON_MODIFIED.join('test') 
+testdir = lib_pypy.LIB_PYTHON.join('test')


More information about the pypy-commit mailing list