[py-svn] r51135 - in py/branch/event/py: . test test/testing

hpk at codespeak.net hpk at codespeak.net
Wed Jan 30 16:53:22 CET 2008


Author: hpk
Date: Wed Jan 30 16:53:21 2008
New Revision: 51135

Modified:
   py/branch/event/py/__init__.py
   py/branch/event/py/test/item.py
   py/branch/event/py/test/testing/test_session.py
Log:
removing rather useless (IMO) py.test - 'notimplemented' and 'broken' logic 


Modified: py/branch/event/py/__init__.py
==============================================================================
--- py/branch/event/py/__init__.py	(original)
+++ py/branch/event/py/__init__.py	Wed Jan 30 16:53:21 2008
@@ -31,8 +31,6 @@
     'test.skip'              : ('./test/item.py', 'skip'),
     'test.fail'              : ('./test/item.py', 'fail'),
     'test.exit'              : ('./test/session.py', 'exit'),
-    'test.broken'            : ('./test/item.py', 'Broken'),
-    'test.notimplemented'    : ('./test/item.py', '_NotImplemented'),
     'test.pdb'               : ('./test/custompdb.py', 'set_trace'),
 
     # configuration/initialization related test api

Modified: py/branch/event/py/test/item.py
==============================================================================
--- py/branch/event/py/test/item.py	(original)
+++ py/branch/event/py/test/item.py	Wed Jan 30 16:53:21 2008
@@ -67,28 +67,9 @@
         """ execute the given test function. """
         target(*args)
 
-#
-# triggering specific outcomes while executing Items
-#
-class BaseReason(object):
-    def __init__(self, msg="unknown reason", **kwds):
-        self.msg = msg
-        self.__dict__.update(kwds)
-
-    def __repr__(self):
-        return self.msg
-
-class Broken(BaseReason):
-    def __repr__(self):
-        return "Broken: %s" % (self.msg,)
-
-class _NotImplemented(BaseReason):
-    def __repr__(self):
-        return "Not implemented: %s" % (self.msg,)
-
 # whatever comes here....
 
-def skip(msg=BaseReason()):
+def skip(msg=""):
     """ skip with the given Message. """
     __tracebackhide__ = True
     raise Skipped(msg=msg) 

Modified: py/branch/event/py/test/testing/test_session.py
==============================================================================
--- py/branch/event/py/test/testing/test_session.py	(original)
+++ py/branch/event/py/test/testing/test_session.py	Wed Jan 30 16:53:21 2008
@@ -277,23 +277,3 @@
         out = l[1].excinfo.exconly()
         assert out.find("[unknown exception raised in repr()]") != -1
         
-def test_skip_reasons():
-    tmp = py.test.ensuretemp("check_skip_reasons")
-    tmp.ensure("test_one.py").write(py.code.Source("""
-        import py
-        def test_1():
-            py.test.skip(py.test.broken('stuff'))
-        
-        def test_2():
-            py.test.skip(py.test.notimplemented('stuff'))
-    """))
-    tmp.ensure("__init__.py")
-    config = py.test.config._reparse([tmp])
-    all = []
-    session = config.initsession()
-    session.main(all.append)
-    skips = getskipped(all)
-    assert len(skips) == 2
-    assert str(skips[0].skipped.value) == 'Broken: stuff'
-    assert str(skips[1].skipped.value) == 'Not implemented: stuff'
-    



More information about the pytest-commit mailing list