]> granicus.if.org Git - python/commit
Add tests for new PyErr_NormalizeException() behavior
authorJeremy Hylton <jeremy@alum.mit.edu>
Wed, 26 Sep 2001 20:01:13 +0000 (20:01 +0000)
committerJeremy Hylton <jeremy@alum.mit.edu>
Wed, 26 Sep 2001 20:01:13 +0000 (20:01 +0000)
commitede049b2d322f160814133677427f7ea0f2ee639
tree0426566f468aa89089338171321378891d60b372
parente2e2c9f41e13d81c6650ae4f4b4ff15a3e6d9423
Add tests for new PyErr_NormalizeException() behavior

Add raise_exception() to the _testcapi module.  It isn't a test, but
the C API exists only to support test_exceptions.  raise_exception()
takes two arguments -- an exception class and an integer specifying
how many arguments it should be called with.

test_exceptions uses BadException() to test the interpreter's behavior
when there is a problem instantiating the exception.  test_capi1()
calls it with too many arguments.  test_capi2() causes an exception to
be raised in the Python code of the constructor.
Lib/test/test_exceptions.py
Modules/_testcapimodule.c