[pypy-svn] r56301 - in pypy/branch/2.5-features/pypy: interpreter/test lib/app_test
bgola at codespeak.net
bgola at codespeak.net
Fri Jul 4 15:41:05 CEST 2008
Author: bgola
Date: Fri Jul 4 15:41:04 2008
New Revision: 56301
Modified:
pypy/branch/2.5-features/pypy/interpreter/test/test_raise.py
pypy/branch/2.5-features/pypy/lib/app_test/test_exception_extra.py
Log:
tests for PEP 352 (BaseException and raise 'string')
Modified: pypy/branch/2.5-features/pypy/interpreter/test/test_raise.py
==============================================================================
--- pypy/branch/2.5-features/pypy/interpreter/test/test_raise.py (original)
+++ pypy/branch/2.5-features/pypy/interpreter/test/test_raise.py Fri Jul 4 15:41:04 2008
@@ -1,6 +1,17 @@
class AppTestRaise:
+ def test_arg_as_string(self):
+ def f():
+ raise "test"
+
+ import warnings
+ warnings.simplefilter('error', DeprecationWarning)
+ try:
+ raises(DeprecationWarning, f)
+ finally:
+ warnings.simplefilter('default', DeprecationWarning)
+
def test_control_flow(self):
try:
raise Exception
Modified: pypy/branch/2.5-features/pypy/lib/app_test/test_exception_extra.py
==============================================================================
--- pypy/branch/2.5-features/pypy/lib/app_test/test_exception_extra.py (original)
+++ pypy/branch/2.5-features/pypy/lib/app_test/test_exception_extra.py Fri Jul 4 15:41:04 2008
@@ -11,3 +11,12 @@
def app_test_import():
import exceptions
assert exceptions.SyntaxError is SyntaxError
+
+def app_test_baseexception():
+ assert issubclass(Exception, BaseException)
+
+def app_test_systemexit():
+ assert issubclass(SystemExit, BaseException)
+
+def app_test_keyboardinterrupt():
+ assert issubclass(KeyboardInterrupt, BaseException)
More information about the Pypy-commit
mailing list