我在PyCharm中运行脚本进行图像比较时出现pytest错误
FileNotFoundError: [Errno 2] No such file or directory:
..\WifiAnalytics\BaseTest.py:50: FileNotFoundError
在此行代码中,我遇到了错误:
def immageComparison(self, ReferenceImage, NewImage):
with open(ReferenceImage , "rb") as imageFile:
完整代码:
def immageComparison(self, ReferenceImage, NewImage):
with open(ReferenceImage , "rb") as imageFile:
str1 = base64.b64encode(imageFile.read())
# print (str1)
with open(NewImage, "rb")as imageFile:
str2 = base64.b64encode(imageFile.read())
# print(str2)
if str1 == str2:
print("True")
return True
else:
print("False")
return False
打印真实