Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test multiple class to GILState.Dispose
  • Loading branch information
lostmsu committed Feb 1, 2020
commit edfa8f708820abcb689f5b4f8536afd682ddf800
21 changes: 21 additions & 0 deletions src/embed_tests/TestGILState.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
namespace Python.EmbeddingTest
{
using NUnit.Framework;
using Python.Runtime;

public class TestGILState
{
/// <summary>
/// Ensure, that calling <see cref="Py.GILState.Dispose"/> multiple times is safe
/// </summary>
[Test]
public void CanDisposeMultipleTimes()
{
using (var gilState = Py.GIL())
{
for(int i = 0; i < 50; i++)
gilState.Dispose();
}
}
}
}