[pypy-svn] r60989 - pypy/trunk/pypy/tool/pytest
hpk at codespeak.net
hpk at codespeak.net
Thu Jan 15 12:01:54 CET 2009
Author: hpk
Date: Thu Jan 15 12:01:53 2009
New Revision: 60989
Modified:
pypy/trunk/pypy/tool/pytest/appsupport.py
pypy/trunk/pypy/tool/pytest/pypy_test_failure_demo.py
Log:
report the source code of a failing app-level raises statement
Modified: pypy/trunk/pypy/tool/pytest/appsupport.py
==============================================================================
--- pypy/trunk/pypy/tool/pytest/appsupport.py (original)
+++ pypy/trunk/pypy/tool/pytest/appsupport.py Thu Jan 15 12:01:53 2009
@@ -196,7 +196,7 @@
for key, w_value in kwds_w.items():
space.setitem(w_locals, space.wrap(key), w_value)
try:
- space.exec_(str(source), frame.w_globals, w_locals)
+ space.exec_(source.compile(), frame.w_globals, w_locals)
except OperationError, e:
if e.match(space, w_ExpectedException):
return space.sys.call('exc_info')
Modified: pypy/trunk/pypy/tool/pytest/pypy_test_failure_demo.py
==============================================================================
--- pypy/trunk/pypy/tool/pytest/pypy_test_failure_demo.py (original)
+++ pypy/trunk/pypy/tool/pytest/pypy_test_failure_demo.py Thu Jan 15 12:01:53 2009
@@ -12,6 +12,11 @@
def test_interp_method(self):
assert self.space.is_true(self.space.w_False)
+def app_test_raises_in_statement():
+ raises(ValueError, """
+ y = x # name error
+ """)
+
def app_test_raises_something():
int("hallo")
More information about the Pypy-commit
mailing list