[pypy-svn] r37867 - in pypy/branch/pytrunkmerge: lib-python pypy/tool/pytest pypy/tool/test

fijal at codespeak.net fijal at codespeak.net
Sat Feb 3 13:35:52 CET 2007


Author: fijal
Date: Sat Feb  3 13:35:48 2007
New Revision: 37867

Modified:
   pypy/branch/pytrunkmerge/lib-python/conftest.py
   pypy/branch/pytrunkmerge/pypy/tool/pytest/appsupport.py
   pypy/branch/pytrunkmerge/pypy/tool/test/test_conftest1.py
Log:
Adapt to outcome.py


Modified: pypy/branch/pytrunkmerge/lib-python/conftest.py
==============================================================================
--- pypy/branch/pytrunkmerge/lib-python/conftest.py	(original)
+++ pypy/branch/pytrunkmerge/lib-python/conftest.py	Sat Feb  3 13:35:48 2007
@@ -12,6 +12,7 @@
 from pypy.interpreter.module import Module as PyPyModule 
 from pypy.interpreter.main import run_string, run_file
 from py.__.misc.simplecapture import callcapture
+from py.__.test.outcome import Failed, Skipped
 
 # the following adds command line options as a side effect! 
 from pypy.conftest import gettestobjspace, option as pypy_option 
@@ -68,8 +69,8 @@
         if appexcinfo.traceback: 
             print "appexcinfo.traceback:"
             py.std.pprint.pprint(appexcinfo.traceback)
-            raise py.test.Item.Failed(excinfo=appexcinfo) 
-        raise py.test.Item.Failed(excinfo=ilevelinfo) 
+            raise Failed(excinfo=appexcinfo) 
+        raise Failed(excinfo=ilevelinfo) 
 
 #
 # compliance modules where we invoke test_main() usually call into 

Modified: pypy/branch/pytrunkmerge/pypy/tool/pytest/appsupport.py
==============================================================================
--- pypy/branch/pytrunkmerge/pypy/tool/pytest/appsupport.py	(original)
+++ pypy/branch/pytrunkmerge/pypy/tool/pytest/appsupport.py	Sat Feb  3 13:35:48 2007
@@ -4,6 +4,7 @@
 from py.__.magic import exprinfo
 from pypy.interpreter import gateway
 from pypy.interpreter.error import OperationError
+from py.__.test.outcome import ExceptionFailure
 
 # ____________________________________________________________
 
@@ -212,7 +213,7 @@
         if not value.match(space, w_ExpectedException):
             raise type, value, tb
         return excinfo
-    except py.test.Item.ExceptionFailure, e:
+    except ExceptionFailure, e:
         e.tbindex = getattr(e, 'tbindex', -1) - 1
         raise
 

Modified: pypy/branch/pytrunkmerge/pypy/tool/test/test_conftest1.py
==============================================================================
--- pypy/branch/pytrunkmerge/pypy/tool/test/test_conftest1.py	(original)
+++ pypy/branch/pytrunkmerge/pypy/tool/test/test_conftest1.py	Sat Feb  3 13:35:48 2007
@@ -3,19 +3,20 @@
 
 innertest = py.magic.autopath().dirpath('conftest1_innertest.py')
 from py.__.test.terminal.terminal import TerminalSession
+from py.__.test.outcome import Passed, Failed, Skipped
 
 class TestPyPyTests: 
     def test_select_interplevel(self): 
         config = py.test.config._reparse([innertest, '-k', 'interplevel'])
         session = TerminalSession(config, py.std.sys.stdout)
         session.main()
-        l = session.getitemoutcomepairs(py.test.Item.Passed)
+        l = session.getitemoutcomepairs(Passed)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('test_something', 'test_method')
         #item = l[0][0]
         #assert item.name == 'test_one'
-        l = session.getitemoutcomepairs(py.test.Item.Skipped)
+        l = session.getitemoutcomepairs(Skipped)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('app_test_something', 'test_method_app')
@@ -24,13 +25,13 @@
         config = py.test.config._reparse([innertest, '-k', 'applevel'])
         session = TerminalSession(config, py.std.sys.stdout)
         session.main()
-        l = session.getitemoutcomepairs(py.test.Item.Passed)
+        l = session.getitemoutcomepairs(Passed)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('app_test_something', 'test_method_app')
         #item = l[0][0]
         #assert item.name == 'test_one'
-        l = session.getitemoutcomepairs(py.test.Item.Skipped)
+        l = session.getitemoutcomepairs(Skipped)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('test_something', 'test_method')
@@ -40,13 +41,13 @@
                                           '-k', 'applevel', '--appdirect'])
         session = TerminalSession(config, py.std.sys.stdout)
         session.main()
-        l = session.getitemoutcomepairs(py.test.Item.Passed)
+        l = session.getitemoutcomepairs(Passed)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('app_test_something', 'test_method_app')
         #item = l[0][0]
         #assert item.name == 'test_one'
-        l = session.getitemoutcomepairs(py.test.Item.Skipped)
+        l = session.getitemoutcomepairs(Skipped)
         assert len(l) == 2 
         for item in l:
             assert item[0].name in ('test_something', 'test_method')



More information about the Pypy-commit mailing list