X Tutup
Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit 2871d1b

Browse files
committed
Re-order Initialize tests
1 parent c0fb3f2 commit 2871d1b

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

src/embed_tests/pyinitialize.cs

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,18 @@ namespace Python.EmbeddingTest
55
{
66
public class PyInitializeTest
77
{
8+
/// <summary>
9+
/// Tests issue with multiple simple Initialize/Shutdowns.
10+
/// Fixed by #343
11+
/// </summary>
812
[Test]
9-
public static void LoadSpecificArgs()
13+
public static void StartAndStopTwice()
1014
{
11-
var args = new[] { "test1", "test2" };
12-
using (new PythonEngine(args))
13-
using (var argv = new PyList(Runtime.Runtime.PySys_GetObject("argv")))
14-
{
15-
Assert.AreEqual(args[0], argv[0].ToString());
16-
Assert.AreEqual(args[1], argv[1].ToString());
17-
}
15+
PythonEngine.Initialize();
16+
PythonEngine.Shutdown();
17+
18+
PythonEngine.Initialize();
19+
PythonEngine.Shutdown();
1820
}
1921

2022
[Test]
@@ -28,13 +30,15 @@ public static void LoadDefaultArgs()
2830
}
2931

3032
[Test]
31-
public static void StartAndStopTwice()
33+
public static void LoadSpecificArgs()
3234
{
33-
PythonEngine.Initialize();
34-
PythonEngine.Shutdown();
35-
36-
PythonEngine.Initialize();
37-
PythonEngine.Shutdown();
35+
var args = new[] { "test1", "test2" };
36+
using (new PythonEngine(args))
37+
using (var argv = new PyList(Runtime.Runtime.PySys_GetObject("argv")))
38+
{
39+
Assert.AreEqual(args[0], argv[0].ToString());
40+
Assert.AreEqual(args[1], argv[1].ToString());
41+
}
3842
}
3943

4044
[Test]

0 commit comments

Comments
 (0)
X Tutup