diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2dd75c529..38782dfb4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -6,7 +6,7 @@ jobs: build-test: name: Build and Test runs-on: ${{ matrix.os }}-latest - timeout-minutes: 5 + timeout-minutes: 7 strategy: fail-fast: false diff --git a/pyproject.toml b/pyproject.toml index 9bcf734c6..b6df82f71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,5 +5,5 @@ build-backend = "setuptools.build_meta" [tool.pytest.ini_options] xfail_strict = true testpaths = [ - "tests", + "tests" ] diff --git a/pythonnet.sln b/pythonnet.sln index e02948c18..eca470595 100644 --- a/pythonnet.sln +++ b/pythonnet.sln @@ -12,7 +12,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.Test", "src\testing\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.PerformanceTests", "src\perf_tests\Python.PerformanceTests.csproj", "{4F2EA4A1-7ECA-48B5-8077-7A3C366F9931}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "src\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Python.DomainReloadTests", "tests\domain_tests\Python.DomainReloadTests.csproj", "{F2FB6DA3-318E-4F30-9A1F-932C667E38C5}" EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Repo", "Repo", "{441A0123-F4C6-4EE4-9AEE-315FD79BE2D5}" ProjectSection(SolutionItems) = preProject diff --git a/src/domain_tests/conftest.py b/src/domain_tests/conftest.py deleted file mode 100644 index 5f0d52e10..000000000 --- a/src/domain_tests/conftest.py +++ /dev/null @@ -1,7 +0,0 @@ -import os - -from subprocess import check_call -# test_proj_path = os.path.join(cwd, "..", "testing") -cfd = os.path.dirname(__file__) -bin_path = os.path.join(cfd, 'bin') -check_call(["dotnet", "build", cfd, '-o', bin_path]) \ No newline at end of file diff --git a/tests/conftest.py b/tests/conftest.py index cf3341f01..0361830d6 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -29,6 +29,8 @@ def pytest_addoption(parser): help="Must be one of default, netcore, netfx and mono" ) +collect_ignore = [] + def pytest_configure(config): global bin_path if "clr" in sys.modules: @@ -73,6 +75,21 @@ def pytest_configure(config): import clr clr.AddReference("Python.Test") + soft_mode = False + try: + os.environ['PYTHONNET_SHUTDOWN_MODE'] == 'Soft' + except: pass + + if config.getoption("--runtime") == "netcore" or soft_mode\ + : + collect_ignore.append("domain_tests/test_domain_reload.py") + else: + domain_tests_dir = os.path.join(os.path.dirname(__file__), "domain_tests") + bin_path = os.path.join(domain_tests_dir, "bin") + check_call(["dotnet", "build", domain_tests_dir, "-o", bin_path]) + + + def pytest_unconfigure(config): global bin_path diff --git a/src/domain_tests/App.config b/tests/domain_tests/App.config similarity index 100% rename from src/domain_tests/App.config rename to tests/domain_tests/App.config diff --git a/src/domain_tests/Python.DomainReloadTests.csproj b/tests/domain_tests/Python.DomainReloadTests.csproj similarity index 89% rename from src/domain_tests/Python.DomainReloadTests.csproj rename to tests/domain_tests/Python.DomainReloadTests.csproj index 54196f210..9cb61c6f4 100644 --- a/src/domain_tests/Python.DomainReloadTests.csproj +++ b/tests/domain_tests/Python.DomainReloadTests.csproj @@ -16,7 +16,7 @@ - + diff --git a/src/domain_tests/TestRunner.cs b/tests/domain_tests/TestRunner.cs similarity index 100% rename from src/domain_tests/TestRunner.cs rename to tests/domain_tests/TestRunner.cs diff --git a/src/domain_tests/test_domain_reload.py b/tests/domain_tests/test_domain_reload.py similarity index 100% rename from src/domain_tests/test_domain_reload.py rename to tests/domain_tests/test_domain_reload.py