| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -6,6 +6,7 @@ | |||
| 6 | 6 | ||
| 7 | 7 | <ItemGroup> | |
| 8 | 8 | <ProjectReference Include="..\runtime\Python.Runtime.csproj" /> | |
| 9 | + <ProjectReference Include="..\testing\Python.Test.csproj" /> | ||
| 9 | 10 | </ItemGroup> | |
| 10 | 11 | ||
| 11 | 12 | <ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -8,6 +8,7 @@ | |||
| 8 | 8 | using NUnit.Framework; | |
| 9 | 9 | ||
| 10 | 10 | using Python.Runtime; | |
| 11 | + using Python.Test; | ||
| 11 | 12 | ||
| 12 | 13 | namespace Python.PythonTestsRunner | |
| 13 | 14 | { | |
@@ -50,7 +51,7 @@ public void RunPythonTest(string testFile, string testName) | |||
| 50 | 51 | { | |
| 51 | 52 | folder = Path.GetDirectoryName(folder); | |
| 52 | 53 | } | |
| 53 | - folder = Path.Combine(folder, "tests"); | ||
| 54 | + folder = Path.Combine(folder, "..", "tests"); | ||
| 54 | 55 | string path = Path.Combine(folder, testFile + ".py"); | |
| 55 | 56 | if (!File.Exists(path)) throw new FileNotFoundException("Cannot find test file", path); | |
| 56 | 57 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -31,6 +31,12 @@ def pytest_addoption(parser): | |||
| 31 | 31 | ||
| 32 | 32 | def pytest_configure(config): | |
| 33 | 33 | global bin_path | |
| 34 | + if "clr" in sys.modules: | ||
| 35 | + # Already loaded (e.g. by the C# test runner), skip build | ||
| 36 | + import clr | ||
| 37 | + clr.AddReference("Python.Test") | ||
| 38 | + return | ||
| 39 | + | ||
| 34 | 40 | runtime_opt = config.getoption("runtime") | |
| 35 | 41 | ||
| 36 | 42 | test_proj_path = os.path.join(cwd, "..", "src", "testing") | |
@@ -70,7 +76,10 @@ def pytest_configure(config): | |||
| 70 | 76 | ||
| 71 | 77 | def pytest_unconfigure(config): | |
| 72 | 78 | global bin_path | |
| 73 | - shutil.rmtree(bin_path) | ||
| 79 | + try: | ||
| 80 | + shutil.rmtree(bin_path) | ||
| 81 | + except Exception: | ||
| 82 | + pass | ||
| 74 | 83 | ||
| 75 | 84 | def pytest_report_header(config): | |
| 76 | 85 | """Generate extra report headers""" | |
| Back | FazBrowse Home | New Git URL |
0 commit comments