Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit24683d0

Browse files
committed
EmbeddedPythonTest gives helpful error message if test file is not found
1 parentf94f97f commit24683d0

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
@@ -40,12 +40,14 @@ public void EmbeddedPythonTest(string testFile, string testName)
4040
folder=Path.GetDirectoryName(folder);
4141
}
4242
folder=Path.Combine(folder,"tests");
43+
stringpath=Path.Combine(folder,testFile+".py");
44+
if(!File.Exists(path))thrownewFileNotFoundException("Cannot find test file",path);
4345

4446
PythonEngine.Exec($@"
4547
import sys
4648
sys.path.insert(0, r'{folder}')
47-
from{testFile} import *
48-
{testName}()
49+
import{testFile}
50+
{testFile}.{testName}()
4951
");
5052
}
5153
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp