8000 EmbeddedPythonTest is even smarter about finding tests directory · pythonnet/pythonnet@f2ceaf6 · GitHub
[go: up one dir, main page]

Skip to content

Commit f2ceaf6

Browse files
committed
EmbeddedPythonTest is even smarter about finding tests directory
1 parent bb7ff4d commit f2ceaf6

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/embed_tests/TestPythonTests.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
using System.Linq;
55
using System.Reflection;
66
using System.Text;
7+
78
using NUnit.Framework;
9+
810
using Python.Runtime;
911

1012
namespace Python.EmbeddingTest
@@ -32,8 +34,8 @@ static IEnumerable<string[]> MyTestCases()
3234
public void EmbeddedPythonTest(string testFile, string testName)
3335
{
3436
// Find the tests directory
35-
string folder = Directory.GetCurrentDirectory();
36-
while(Path.GetFileName(folder) != "src")
37+
string folder = typeof(TestPythonTests).Assembly.Location;
38+
while (Path.GetFileName(folder) != "src")
3739
{
3840
folder = Path.GetDirectoryName(folder);
3941
}

0 commit comments

Comments
 (0)
0