enabling assertions with jython, fixing one .format occurence
to provide the setting for http://paste.pocoo.org/show/147361/ --HG-- branch : trunk
This commit is contained in:
parent
d2e6cd0523
commit
84efdacfc0
|
@ -109,7 +109,7 @@ class DebugInterpreter(ast.NodeVisitor):
|
||||||
raise Failure()
|
raise Failure()
|
||||||
return None, None
|
return None, None
|
||||||
else:
|
else:
|
||||||
raise AssertionError("can't handle {0}".format(node))
|
raise AssertionError("can't handle %s" %(node,))
|
||||||
|
|
||||||
def _compile(self, source, mode="eval"):
|
def _compile(self, source, mode="eval"):
|
||||||
return compile(source, "<assertion interpretation>", mode)
|
return compile(source, "<assertion interpretation>", mode)
|
||||||
|
|
|
@ -8,8 +8,8 @@ def pytest_addoption(parser):
|
||||||
help="disable python assert expression reinterpretation."),
|
help="disable python assert expression reinterpretation."),
|
||||||
|
|
||||||
def pytest_configure(config):
|
def pytest_configure(config):
|
||||||
if sys.platform.startswith("java"):
|
#if sys.platform.startswith("java"):
|
||||||
return # XXX assertions don't work yet with jython 2.5.1
|
# return # XXX assertions don't work yet with jython 2.5.1
|
||||||
|
|
||||||
if not config.getvalue("noassert") and not config.getvalue("nomagic"):
|
if not config.getvalue("noassert") and not config.getvalue("nomagic"):
|
||||||
warn_about_missing_assertion()
|
warn_about_missing_assertion()
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import py
|
import py
|
||||||
|
|
||||||
pytestmark = py.test.mark.skipif("sys.platform.startswith('java')")
|
#pytestmark = py.test.mark.skipif("sys.platform.startswith('java')")
|
||||||
|
|
||||||
def exvalue():
|
def exvalue():
|
||||||
return py.std.sys.exc_info()[1]
|
return py.std.sys.exc_info()[1]
|
||||||
|
|
Loading…
Reference in New Issue