Skip to content

Commit a170ce8

Browse files
authored
Enable test_clrexception (#1043)
1 parent d32a2b5 commit a170ce8

2 files changed

Lines changed: 7 additions & 12 deletions

File tree

Src/IronPythonTest/Cases/IronPythonCasesManifest.ini

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ RunCondition=NOT $(IS_POSIX)
1616
Reason=Causes an abort on mono, needs debug
1717
Ignore=true
1818

19-
[IronPython.test_clrexception]
20-
Ignore=true
21-
2219
[IronPython.test_clrload]
2320
IsolationLevel=PROCESS # requires System.Drawing assembly to be unloaded
2421

Tests/test_clrexception.py

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -47,19 +47,12 @@ def test_mappings(self):
4747

4848
# Tests for exact mappings
4949

50-
# BUG 515 System.SystemException not mapped to StandardError
51-
self.clr_to_py_positive(System.SystemException, Exception)
52-
# /BUG
53-
54-
self.clr_to_py_positive(System.IO.IOException, IOError, msg = "System.IO.IOException -> IOError")
55-
self.py_to_clr_positive(IOError, System.IO.IOException, msg = "IOError -> System.IO.IOException")
50+
self.clr_to_py_positive(System.SystemException, SystemError, msg = "System.SystemException -> SystemError")
51+
self.py_to_clr_positive(SystemError, System.SystemException, msg = "SystemError -> System.SystemException")
5652

5753
self.clr_to_py_positive(System.MissingMemberException, AttributeError, msg ="System.MissingMemberException -> AttributeError")
5854
self.py_to_clr_positive(AttributeError, System.MissingMemberException, msg = "AttributeError -> System.MissingMemberException")
5955

60-
self.clr_to_py_positive(System.ComponentModel.Win32Exception, WindowsError, msg ="System.ComponentModel.Win32Exception -> WindowsError")
61-
self.py_to_clr_positive(WindowsError, System.ComponentModel.Win32Exception, msg = "WindowsError -> System.ComponentModel.Win32Exception")
62-
6356
self.clr_to_py_positive(System.IO.EndOfStreamException, EOFError, msg="System.IO.EndOfStreamException -> EOFError")
6457
self.py_to_clr_positive(EOFError, System.IO.EndOfStreamException, msg = "EOFError -> System.IO.EndOfStreamException")
6558

@@ -95,8 +88,13 @@ def test_mappings(self):
9588

9689
self.clr_to_py_positive(System.Collections.Generic.KeyNotFoundException, KeyError, msg = "System.Collections.Generic.KeyNotFoundException -> KeyError")
9790
self.py_to_clr_positive(KeyError, System.Collections.Generic.KeyNotFoundException, msg = "KeyError -> System.Collections.Generic.KeyNotFoundException")
91+
9892
# Tests for inexact mappings
9993

94+
# These used to have exact mappings with IronPython 2
95+
self.clr_to_py_positive(System.IO.IOException, SystemError, msg = "System.IO.IOException -> SystemError")
96+
self.clr_to_py_positive(System.ComponentModel.Win32Exception, WindowsError, msg ="System.ComponentModel.Win32Exception -> WindowsError")
97+
10098
# Let CLR exception class A map to Python error type B;
10199
# let A' be a direct subclass of A, with *no* direct mapping to a Python error type;
102100
# then A' should be caught in Iron Python as an instance of B.

0 commit comments

Comments
 (0)