File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 1
- using System ;
1
+ using System ;
2
2
using NUnit . Framework ;
3
3
using Python . Runtime ;
4
4
5
5
namespace Python . EmbeddingTest
6
6
{
7
7
public class TestRuntime
8
8
{
9
+ [ OneTimeSetUp ]
10
+ public void SetUp ( )
11
+ {
12
+ // We needs to ensure that no any engines are running.
13
+ if ( PythonEngine . IsInitialized )
14
+ {
15
+ PythonEngine . Shutdown ( ) ;
16
+ }
17
+ }
18
+
9
19
[ Test ]
10
20
public static void Py_IsInitializedValue ( )
11
21
{
12
- Runtime . Runtime . Py_Finalize ( ) ; // In case another test left it on.
22
+ // We defenitely knows that all engines are shut downed.
23
+ // Runtime.Runtime.Py_Finalize();
13
24
Assert . AreEqual ( 0 , Runtime . Runtime . Py_IsInitialized ( ) ) ;
14
25
Runtime . Runtime . Py_Initialize ( ) ;
15
26
Assert . AreEqual ( 1 , Runtime . Runtime . Py_IsInitialized ( ) ) ;
You can’t perform that action at this time.
0 commit comments