File tree Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Expand file tree Collapse file tree 3 files changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -64,6 +64,17 @@ public virtual void OnTestEvent(int value)
64
64
}
65
65
}
66
66
67
+ public abstract class RecursiveInheritance
68
+ {
69
+ public class SubClass : RecursiveInheritance
70
+ {
71
+ public void SomeMethod ( )
72
+ {
73
+
74
+ }
75
+ }
76
+ }
77
+
67
78
public class TestFunctions
68
79
{
69
80
public static string test_foo ( IInterfaceTest x )
Original file line number Diff line number Diff line change 4
4
5
5
from .test_import import test_suite as import_tests
6
6
from .test_callback import test_suite as callback_tests
7
+ from .test_recursiveTypes import test_suite as recursiveTypes_tests
7
8
8
9
def test_suite ():
9
10
suite = unittest .TestSuite ()
10
11
suite .addTests ((import_tests (),))
11
12
suite .addTests ((callback_tests (),))
13
+ suite .addTests ((recursiveTypes_tests (),))
12
14
return suite
Original file line number Diff line number Diff line change
1
+ import unittest , sys
2
+ import clr
3
+
4
+ this_module = sys .modules [__name__ ]
5
+ clr .AddReference ("Python.Test" )
6
+ class RecursiveTypesTests (unittest .TestCase ):
7
+ """Test if interop with recursive type inheritance works."""
8
+
9
+ def testRecursiveTypeCreation (self ):
10
+ """Test that a recursive types don't crash with a StackOverflowException"""
11
+ import Python .Test as Test
12
+ from Python .Test import RecursiveInheritance
13
+ test_instance = RecursiveInheritance .SubClass ()
14
+ test_instance .SomeMethod ()
15
+ pass
16
+
17
+
18
+ def test_suite ():
19
+ return unittest .makeSuite (RecursiveTypesTests )
20
+
You can’t perform that action at this time.
0 commit comments