Skip to content

Commit 0212233

Browse files
author
dse
committed
Debug info added!
1 parent 5ddbdb8 commit 0212233

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

src/embed_tests/FinalShutdown.cs

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
using System;
2+
using NUnit.Framework;
3+
using Python.Runtime;
4+
5+
namespace Python.EmbeddingTest
6+
{
7+
[SetUpFixture]
8+
public class FinalShutdown
9+
{
10+
[OneTimeTearDown]
11+
public void Finalize()
12+
{
13+
TestContext.Progress.WriteLine("This is global shutdown!");
14+
Console.Error.WriteLine("Trying finalyze test.");
15+
if (PythonEngine.IsInitialized)
16+
{
17+
Console.Error.WriteLine("Direct shutdown!");
18+
PythonEngine.Shutdown();
19+
}
20+
}
21+
}
22+
}

src/embed_tests/TestFinalizer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public void SetUp()
2323
[Test]
2424
public void SynchronousAllocationTest()
2525
{
26+
Console.Error.WriteLine("sync started");
2627
// If GC does not works, we will consume 10G.
2728
for (int i = 0; i < 50; i++)
2829
{
@@ -41,11 +42,13 @@ public void SynchronousAllocationTest()
4142

4243
// We need to consume less that 1Gb.
4344
Assert.Less(totalMemoryConsumed, 1000000000);
45+
Console.Error.WriteLine("sync finished");
4446
}
4547

4648
[Test]
4749
public void AsyncAllocationTest()
4850
{
51+
Console.Error.WriteLine("Async started");
4952
var gs = PythonEngine.BeginAllowThreads();
5053
try
5154
{
@@ -77,6 +80,7 @@ public void AsyncAllocationTest()
7780

7881
// We need to consume less that 1Gb.
7982
Assert.Less(totalMemoryConsumed, 1000000000);
83+
Console.Error.WriteLine("Async Finished");
8084
}
8185
}
8286
}

0 commit comments

Comments
 (0)