Skip to content

Commit 3b1befa

Browse files
committed
Fix the gradle syntax bug
1 parent c277548 commit 3b1befa

File tree

1 file changed

+17
-13
lines changed

1 file changed

+17
-13
lines changed

gradle/python.gradle

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -266,25 +266,29 @@ task uninstall(type: Task) {
266266

267267
/***** Verification Group */
268268

269-
/* Run all python tests from testRoot */
269+
/* Run all python unittests from sourceRoot */
270270
task check(type: Task) {
271271
group = 'Verification'
272-
description = "Run all python tests from testRoot"
272+
description = "Run all python unittests from sourceRoot"
273273
dependsOn compilePython
274274
dependsOn compileQrc
275275
doLast {
276276
println "Executing all unittests from ${sourceRoot}"
277-
if (verbose) {
278-
println ""
279-
println " PYTHON_PATHS: "
280-
println "\t|- ${project.ext.pythonPath.split(':').join('\n\t|- ')}"
281-
println "Executing unittests from -> ${file.name}"
282-
println ""
283-
}
284-
exec {
285-
workingDir = "${sourceRoot}/test"
286-
environment PYTHONPATH: pythonPath
287-
commandLine project.python, '-m', 'pytest', '--no-header', '-vv'
277+
fileTree("${sourceRoot}/test").matching {
278+
include "**/test_*.py"
279+
}.each { File file ->
280+
if (verbose) {
281+
println ""
282+
println " PYTHONPATH: "
283+
println "\t|- ${project.ext.pythonPath.split(':').join('\n\t|- ')}"
284+
println "Executing unittests from -> ${file.name}"
285+
println ""
286+
}
287+
exec {
288+
workingDir = dirName(file)
289+
environment PYTHONPATH: pythonPath
290+
commandLine project.python, '-m', 'unittest', '-b', '-f', '-v' , file.path
291+
}
288292
}
289293
}
290294
}

0 commit comments

Comments
 (0)