Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d3b56ff

Browse files
committed
Ensure that sub-processes in tests use the same runtime settings
1 parent ddf5a70 commit d3b56ff

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tests/conftest.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,10 @@ def pytest_configure(config):
7979
["dotnet", "publish", "-f", fw, "-o", str(bin_path), str(test_proj_path)]
8080
)
8181

82-
from pythonnet import load
83-
84-
load(runtime_opt, **runtime_params)
82+
import os
83+
os.environ["PYTHONNET_RUNTIME"] = runtime_opt
84+
for k, v in runtime_params.items():
85+
os.environ[f"PYTHONNET_{runtime_opt.upper()}_{k.upper()}"] = v
8586

8687
import clr
8788

0 commit comments

Comments
 (0)