Thanks to visit codestin.com Credit goes to github.com
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e9e5c60 commit 64acfcbCopy full SHA for 64acfcb
src/embed_tests/TestRuntime.cs
@@ -1,15 +1,26 @@
1
-using System;
+using System;
2
using NUnit.Framework;
3
using Python.Runtime;
4
5
namespace Python.EmbeddingTest
6
{
7
public class TestRuntime
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
+
19
[Test]
20
public static void Py_IsInitializedValue()
21
- 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();
24
Assert.AreEqual(0, Runtime.Runtime.Py_IsInitialized());
25
Runtime.Runtime.Py_Initialize();
26
Assert.AreEqual(1, Runtime.Runtime.Py_IsInitialized());
0 commit comments