Skip to content

Commit 90e3f5f

Browse files
authored
Merge pull request #325 from elautz/coverage-null-path
Added a null check for the htmlDir in PyCoverageTask
2 parents 26c6ba2 + cb03227 commit 90e3f5f

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

pygradle-plugin/src/main/groovy/com/linkedin/gradle/python/tasks/PyCoverageTask.groovy

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,10 @@ class PyCoverageTask extends PyTestTask {
7373
String htmlDir = streamProcessor.htmlDir
7474
String coverage = streamProcessor.coverage
7575

76-
77-
FileUtils.copyDirectoryToDirectory(project.file(htmlDir), coverageOutputDir)
76+
// If there is no coverage to report, then the htmlDir value will be empty
77+
if (htmlDir != null) {
78+
FileUtils.copyDirectoryToDirectory(project.file(htmlDir), coverageOutputDir)
79+
}
7880

7981
CoverageXmlReporter coverageXmlReport = new CoverageXmlReporter(coverage)
8082
coverageReport.text = coverageXmlReport.generateXML()

0 commit comments

Comments
 (0)