From e8a1e99514f84e2b28b6da80740375694717e76c Mon Sep 17 00:00:00 2001 From: Victor Milovanov Date: Mon, 9 Mar 2020 22:06:27 -0700 Subject: [PATCH] Python runtime must be initialized before trying to acquire GIL --- src/embed_tests/TestGILState.cs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/embed_tests/TestGILState.cs b/src/embed_tests/TestGILState.cs index ba2ab500f..bf6f02dc6 100644 --- a/src/embed_tests/TestGILState.cs +++ b/src/embed_tests/TestGILState.cs @@ -17,5 +17,17 @@ public void CanDisposeMultipleTimes() gilState.Dispose(); } } + + [OneTimeSetUp] + public void SetUp() + { + PythonEngine.Initialize(); + } + + [OneTimeTearDown] + public void Dispose() + { + PythonEngine.Shutdown(); + } } }