File tree Expand file tree Collapse file tree 2 files changed +20
-7
lines changed
Expand file tree Collapse file tree 2 files changed +20
-7
lines changed Original file line number Diff line number Diff line change 11using System ;
22using System . Collections . Generic ;
3+ using System . IO ;
34using System . Linq ;
45using System . Reflection ;
56using System . Text ;
89
910namespace Python . EmbeddingTest
1011{
11- public class TestList
12+ public class TestPythonTests
1213 {
1314 [ OneTimeSetUp ]
1415 public void SetUp ( )
@@ -22,14 +23,21 @@ public void Dispose()
2223 PythonEngine . Shutdown ( ) ;
2324 }
2425
25- [ Test ]
26- public void MissingGenericTypeTest ( )
26+ static IEnumerable < string [ ] > MyTestCases ( )
2727 {
28- Assert . Throws < PythonException > ( ( ) =>
28+ yield return new [ ] { "test_generic" , "test_missing_generic_type" } ;
29+ }
30+
31+ [ TestCaseSource ( nameof ( MyTestCases ) ) ]
32+ public void EmbeddedPythonTest ( string testFile , string testName )
33+ {
34+ string folder = @"..\\..\\..\\..\\tests" ;
2935 PythonEngine . Exec ( $@ "
30- from System.Collections import IList
31- IList[bool]
32- " ) ) ;
36+ import sys
37+ sys.path.insert(0, '{ folder } ')
38+ from { testFile } import *
39+ { testName } ()
40+ " ) ;
3341 }
3442 }
3543}
Original file line number Diff line number Diff line change @@ -745,3 +745,8 @@ def test_nested_generic_class():
745745 """Check nested generic classes."""
746746 # TODO NotImplemented
747747 pass
748+
749+ def test_missing_generic_type ():
750+ from System .Collections import IList
751+ with pytest .raises (TypeError ):
752+ IList [bool ]
You can’t perform that action at this time.
0 commit comments