From 84efdacfc0e4d9b691c35a82574b200f2e81725d Mon Sep 17 00:00:00 2001 From: holger krekel Date: Tue, 27 Oct 2009 21:51:05 +0100 Subject: [PATCH] enabling assertions with jython, fixing one .format occurence to provide the setting for http://paste.pocoo.org/show/147361/ --HG-- branch : trunk --- _py/code/_assertionnew.py | 2 +- _py/test/plugin/pytest_assertion.py | 4 ++-- testing/code/test_assertion.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/_py/code/_assertionnew.py b/_py/code/_assertionnew.py index 606dfa75c..42a1da52d 100644 --- 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, "", mode) diff --git a/_py/test/plugin/pytest_assertion.py b/_py/test/plugin/pytest_assertion.py index 44974d194..0e15c4e99 100644 --- 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() diff --git a/testing/code/test_assertion.py b/testing/code/test_assertion.py index 7427df371..c84add999 100644 --- 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]