Re-enable the domain reload tests (#1404) · pythonnet/pythonnet@33d771c

9 files changed

lines changed

Original file line numberDiff line numberDiff line change

@@ -6,7 +6,7 @@ jobs:

66

build-test:

77

name: Build and Test

88

runs-on: ${{ matrix.os }}-latest

9-

timeout-minutes: 5

9+

timeout-minutes: 7

1010
1111

strategy:

1212

fail-fast: false

Original file line numberDiff line numberDiff line change

@@ -5,5 +5,5 @@ build-backend = "setuptools.build_meta"

55

[tool.pytest.ini_options]

66

xfail_strict = true

77

testpaths = [

8-

"tests",

8+

"tests"

99

]

Original file line numberDiff line numberDiff line change

@@ -12,7 +12,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test", "src\testing\

1212

EndProject

1313

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.PerformanceTests", "src\perf_tests\Python.PerformanceTests.csproj", "{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}"

1414

EndProject

15-

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "src\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}"

15+

Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "tests\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}"

1616

EndProject

1717

Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F4C6-4EE4-9AEE-315FD79BE2D5}"

1818

ProjectSection(SolutionItems) = preProject

Original file line numberDiff line numberDiff line change

@@ -29,6 +29,8 @@ def pytest_addoption(parser):

2929

help="Must be one of default, netcore, netfx and mono"

3030

)

3131
32+

collect_ignore = []

33+
3234

def pytest_configure(config):

3335

global bin_path

3436

if "clr" in sys.modules:

@@ -73,6 +75,21 @@ def pytest_configure(config):

7375

import clr

7476

clr.AddReference("Python.Test")

7577
78+

soft_mode = False

79+

try:

80+

os.environ['PYTHONNET_SHUTDOWN_MODE'] == 'Soft'

81+

except: pass

82+
83+

if config.getoption("--runtime") == "netcore" or soft_mode\

84+

:

85+

collect_ignore.append("domain_tests/test_domain_reload.py")

86+

else:

87+

domain_tests_dir = os.path.join(os.path.dirname(__file__), "domain_tests")

88+

bin_path = os.path.join(domain_tests_dir, "bin")

89+

check_call(["dotnet", "build", domain_tests_dir, "-o", bin_path])

90+
91+
92+
7693
7794

def pytest_unconfigure(config):

7895

global bin_path

File renamed without changes.

Original file line numberDiff line numberDiff line change

@@ -16,7 +16,7 @@

1616

</ItemGroup>

1717
1818

<ItemGroup>

19-

<ProjectReference Include="..\runtime\Python.Runtime.csproj" />

19+

<ProjectReference Include="..\..\src\runtime\Python.Runtime.csproj" />

2020

</ItemGroup>

2121
2222

<ItemGroup>

File renamed without changes.

File renamed without changes.