From on December 9, 2014 17:52
IronPython 2.7 Beta 2 fails to catch CLR exceptions in assertRaises. The attached patch fixes the issue.
prompt% cat spam.py
"""This file is spam.py."""
import unittest
from System import InvalidOperationException
class Issue(unittest.TestCase):
def test_assertRaises(self):
with self.assertRaises(InvalidOperationException):
raise InvalidOperationException('assertRaises should catch this')
prompt% ipy -m unittest spam
E
ERROR: test_assertRaises (spam.Issue)
Traceback (most recent call last):
File "C:\cygwin\home\Johiga\qmdl_test\spam.py", line 6, in test_assertRaises
raise InvalidOperationException('assertRaises should catch this')
SystemError: assertRaises should catch this
Ran 1 test in 0.078s
FAILED (errors=1)
Work Item Details
Original CodePlex Issue: Issue 30119 Status: Active Reason Closed: Unassigned Assigned to: jdhardy Reported on: Feb 8, 2011 at 1:10 AM Reported by: jonathanhiga Updated on: Sep 12 at 1:14 PM Updated by: slide_o_mix
Plaintext Attachments
CodePlex Issue #30119 Plain Text Attachments
Copied from original issue: IronLanguages/main#919
该提问来源于开源项目:IronLanguages/ironpython2