[py-svn] py-trunk commit acf745993e90: enabling assertions with jython, fixing one .format occurence

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Oct 27 21:51:19 CET 2009


# HG changeset patch -- Bitbucket.org
# Project py-trunk
# URL http://bitbucket.org/hpk42/py-trunk/overview/
# User holger krekel <holger at merlinux.eu>
# Date 1256676665 -3600
# Node ID acf745993e90a77c326d8a9d41a054dc8b2a61cd
# Parent 68c5479b8f72860ee9f5117388ab0471c019ab1c
enabling assertions with jython, fixing one .format occurence
to provide the setting for http://paste.pocoo.org/show/147361/

--- a/_py/code/_assertionnew.py
+++ b/_py/code/_assertionnew.py
@@ -109,7 +109,7 @@ class DebugInterpreter(ast.NodeVisitor):
                 raise Failure()
             return None, None
         else:
-            raise AssertionError("can't handle {0}".format(node))
+            raise AssertionError("can't handle %s" %(node,))
 
     def _compile(self, source, mode="eval"):
         return compile(source, "<assertion interpretation>", mode)

--- a/_py/test/plugin/pytest_assertion.py
+++ b/_py/test/plugin/pytest_assertion.py
@@ -8,8 +8,8 @@ def pytest_addoption(parser):
         help="disable python assert expression reinterpretation."),
 
 def pytest_configure(config):
-    if sys.platform.startswith("java"):
-        return # XXX assertions don't work yet with jython 2.5.1
+    #if sys.platform.startswith("java"):
+    #    return # XXX assertions don't work yet with jython 2.5.1
 
     if not config.getvalue("noassert") and not config.getvalue("nomagic"):
         warn_about_missing_assertion()

--- a/testing/code/test_assertion.py
+++ b/testing/code/test_assertion.py
@@ -1,6 +1,6 @@
 import py
 
-pytestmark = py.test.mark.skipif("sys.platform.startswith('java')")
+#pytestmark = py.test.mark.skipif("sys.platform.startswith('java')")
 
 def exvalue():
     return py.std.sys.exc_info()[1]



More information about the pytest-commit mailing list