Skip to content

Commit e9283e3

Browse files
committed
Ensure that Python is initialized before probing properties
1 parent da082ac commit e9283e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/embed_tests/TestPythonEngineProperties.cs

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ public class TestPythonEngineProperties
99
[Test]
1010
public static void GetBuildinfoDoesntCrash()
1111
{
12+
PythonEngine.Initialize();
1213
using (Py.GIL())
1314
{
1415
string s = PythonEngine.BuildInfo;
@@ -21,6 +22,7 @@ public static void GetBuildinfoDoesntCrash()
2122
[Test]
2223
public static void GetCompilerDoesntCrash()
2324
{
25+
PythonEngine.Initialize();
2426
using (Py.GIL())
2527
{
2628
string s = PythonEngine.Compiler;
@@ -34,6 +36,7 @@ public static void GetCompilerDoesntCrash()
3436
[Test]
3537
public static void GetCopyrightDoesntCrash()
3638
{
39+
PythonEngine.Initialize();
3740
using (Py.GIL())
3841
{
3942
string s = PythonEngine.Copyright;
@@ -46,6 +49,7 @@ public static void GetCopyrightDoesntCrash()
4649
[Test]
4750
public static void GetPlatformDoesntCrash()
4851
{
52+
PythonEngine.Initialize();
4953
using (Py.GIL())
5054
{
5155
string s = PythonEngine.Platform;
@@ -58,6 +62,7 @@ public static void GetPlatformDoesntCrash()
5862
[Test]
5963
public static void GetVersionDoesntCrash()
6064
{
65+
PythonEngine.Initialize();
6166
using (Py.GIL())
6267
{
6368
string s = PythonEngine.Version;

0 commit comments

Comments
 (0)