2007-01-24 22:24:01 +08:00
|
|
|
import py
|
|
|
|
|
|
|
|
def test_BaseException():
|
|
|
|
assert issubclass(IndexError, py.builtin.BaseException)
|
|
|
|
assert issubclass(Exception, py.builtin.BaseException)
|
|
|
|
assert issubclass(KeyboardInterrupt, py.builtin.BaseException)
|
|
|
|
|
|
|
|
class MyRandomClass(object):
|
|
|
|
pass
|
|
|
|
assert not issubclass(MyRandomClass, py.builtin.BaseException)
|
|
|
|
|
|
|
|
assert py.builtin.BaseException.__module__ == 'exceptions'
|
|
|
|
assert Exception.__name__ == 'Exception'
|
2007-09-20 23:17:22 +08:00
|
|
|
|
|
|
|
|
|
|
|
def test_GeneratorExit():
|
|
|
|
assert py.builtin.GeneratorExit.__module__ == 'exceptions'
|
|
|
|
assert issubclass(py.builtin.GeneratorExit, Exception)
|