pytest extra: add more graceful and informative error if parameter is pointing to no valid source files

This commit is contained in:
fedepell 2016-10-24 10:21:40 +02:00 committed by ita1024
parent 0db417ac1a
commit 54a5ebe46a
1 changed files with 4 additions and 1 deletions

View File

@ -114,7 +114,10 @@ def make_pytest(self):
else:
self.ut_cwd = self.path.make_node(self.ut_cwd)
else:
self.ut_cwd = tsk.inputs[0].parent
if tsk.inputs:
self.ut_cwd = tsk.inputs[0].parent
else:
raise Errors.WafError("no valid input files for pytest task, check pytest_source value")
if not self.ut_cwd.exists():
self.ut_cwd.mkdir()