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 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . IO ;
3
4
using System . Linq ;
4
5
using System . Reflection ;
5
6
using System . Text ;
8
9
9
10
namespace Python . EmbeddingTest
10
11
{
11
- public class TestList
12
+ public class TestPythonTests
12
13
{
13
14
[ OneTimeSetUp ]
14
15
public void SetUp ( )
@@ -22,14 +23,21 @@ public void Dispose()
22
23
PythonEngine . Shutdown ( ) ;
23
24
}
24
25
25
- [ Test ]
26
- public void MissingGenericTypeTest ( )
26
+ static IEnumerable < string [ ] > MyTestCases ( )
27
27
{
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" ;
29
35
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
+ " ) ;
33
41
}
34
42
}
35
43
}
Original file line number Diff line number Diff line change @@ -745,3 +745,8 @@ def test_nested_generic_class():
745
745
"""Check nested generic classes."""
746
746
# TODO NotImplemented
747
747
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