8000 Re-enable the domain reload tests (#1404) · pythonnet/pythonnet@33d771c · GitHub
[go: up one dir, main page]

Skip to content

Commit 33d771c

Browse files
authored
Re-enable the domain reload tests (#1404)
Add `domain_tests` to `testpaths` in pyproject.toml Run domain tests only if domains are supported Move the domain reload tests to the `tests` directory, merge the `conftest.py` files * Don't run domain reload tests in soft mode, increase timeout
1 parent db746aa commit 33d771c

File tree

9 files changed

+21
-11
lines changed

9 files changed

+21
-11
lines changed

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
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

pyproject.toml

Lines changed: 1 addition & 1 deletion
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
]

pythonnet.sln

Lines changed: 1 addition & 1 deletion
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

src/domain_tests/conftest.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

tests/conftest.py

Lines changed: 17 additions & 0 deletions
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.

src/domain_tests/Python.DomainReloadTests.csproj renamed to tests/domain_tests/Python.DomainReloadTests.csproj

Lines changed: 1 addition & 1 deletion
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.

0 commit comments

Comments
 (0)
0