From 6bfddc4650fe3675088f9281fe608e37f7831a54 Mon Sep 17 00:00:00 2001 From: Benedikt Reinartz Date: Tue, 3 Jan 2023 12:49:18 +0100 Subject: [PATCH] Run test for autogenerated config in subprocess Only a single version of a dotnet-core runtime can be loaded at a given time. This off-loads one of our tests to a subprocess (the same pattern would work if we did this for the other test). Could be cleaner, but this will do for now. --- tests/test_common.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/test_common.py b/tests/test_common.py index 1191102..5e5338d 100644 --- a/tests/test_common.py +++ b/tests/test_common.py @@ -57,6 +57,17 @@ def test_coreclr(example_netcore): def test_coreclr_autogenerated_runtimeconfig(example_netstandard): + from multiprocessing import get_context + + p = get_context("spawn").Process( + target=_do_test_coreclr_autogenerated_runtimeconfig, args=(example_netstandard,) + ) + p.start() + p.join() + p.close() + + +def _do_test_coreclr_autogenerated_runtimeconfig(example_netstandard): from clr_loader import get_coreclr coreclr = get_coreclr()