Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit913e429

Browse files
committed
allow tests to pass when objects are leaking due to being GCed after Python runtime is shut down
1 parent5193deb commit913e429

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

‎src/embed_tests/GlobalTestsSetup.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ namespace Python.EmbeddingTest
99
[SetUpFixture]
1010
publicpartialclassGlobalTestsSetup
1111
{
12+
[OneTimeSetUp]
13+
publicvoidGlobalSetup()
14+
{
15+
Finalizer.Instance.ErrorHandler+=FinalizerErrorHandler;
16+
}
17+
18+
privatevoidFinalizerErrorHandler(objectsender,Finalizer.ErrorArgse)
19+
{
20+
if(e.ErrorisRuntimeShutdownException)
21+
{
22+
// allow objects to leak after the python runtime run
23+
// they were created in is gone
24+
e.Handled=true;
25+
}
26+
}
27+
1228
[OneTimeTearDown]
1329
publicvoidFinalCleanup()
1430
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp