3.4: fixes

This commit is contained in:
Alexander Alekhin
2018-09-17 22:13:01 +00:00
parent 70f38b4dfa
commit 3cab9e7a9c
3 changed files with 16 additions and 8 deletions
+3 -2
View File
@@ -26,14 +26,15 @@ class NewOpenCVTests(unittest.TestCase):
# github repository url
repoUrl = 'https://raw.github.com/opencv/opencv/master'
def find_file(self, filename, searchPaths=[]):
def find_file(self, filename, searchPaths=[], required=True):
searchPaths = searchPaths if searchPaths else [self.repoPath, self.extraTestDataPath]
for path in searchPaths:
if path is not None:
candidate = path + '/' + filename
if os.path.isfile(candidate):
return candidate
self.fail('File ' + filename + ' not found')
if required:
self.fail('File ' + filename + ' not found')
return None