[pypy-svn] r9935 - in pypy/dist: lib-python-2.3.4/test pypy/lib/test2

hpk at codespeak.net hpk at codespeak.net
Sun Mar 20 17:59:45 CET 2005


Author: hpk
Date: Sun Mar 20 17:59:45 2005
New Revision: 9935

Modified:
   pypy/dist/lib-python-2.3.4/test/conftest.py
   pypy/dist/pypy/lib/test2/conftest.py
Log:
fix test hacking for lib-python 
and exclude tests in pypy/lib/test2 by
default 


Modified: pypy/dist/lib-python-2.3.4/test/conftest.py
==============================================================================
--- pypy/dist/lib-python-2.3.4/test/conftest.py	(original)
+++ pypy/dist/lib-python-2.3.4/test/conftest.py	Sun Mar 20 17:59:45 2005
@@ -97,11 +97,15 @@
     #print "entering list_testmethods"
     classlist = []
     if callable(getattr(mod, 'test_main', None)): 
+        from test import test_support  # humpf
         def hack_run_unittest(*classes): 
             classlist.extend(list(classes))
-        mod.test_support.run_unittest = hack_run_unittest 
+        test_support.run_unittest = hack_run_unittest 
         mod.test_main() 
-        mod.test_support.run_unittest = None 
+        assert classlist, ("found %s.test_main() but it returned no " 
+                           "test classes" % mod.__name__) 
+        test_support.run_unittest = None  # nobody should really 
+                                          # call it anymore 
     else: 
         # we try to find out fitting tests ourselves 
         for clsname, cls in mod.__dict__.items(): 
@@ -128,6 +132,7 @@
         # ok this is an output test 
         return OutputTestItem(fspath, output) 
     content = fspath.read() 
+    # XXX not exactly clean: 
     if content.find('unittest') != -1: 
         # we can try to run ...  
         return UnittestModule(fspath) 

Modified: pypy/dist/pypy/lib/test2/conftest.py
==============================================================================
--- pypy/dist/pypy/lib/test2/conftest.py	(original)
+++ pypy/dist/pypy/lib/test2/conftest.py	Sun Mar 20 17:59:45 2005
@@ -8,13 +8,10 @@
 assert lib.check(dir=1) 
 conftest = lib.join('conftest.py').getpymodule() 
 
-class Module(conftest.Module): 
-    pass 
+def Module(fspath): 
+    return conftest.Module(fspath) 
 
-class Directory(conftest.Module): 
-    pass 
-
-#class Directory(py.test.collect.Directory): 
-#    def __iter__(self): 
-#        return iter([])
+class Directory(conftest.Directory): 
+    def __iter__(self): 
+        return iter([])
 



More information about the Pypy-commit mailing list