2024-06-09 15:29:32 发布
网友
pytest支持mockito这样的验证吗?在
verify(dummy, atleast=1).foo()
https://code.google.com/p/mockito-python/wiki/Verifications#Verifying_Number_of_Invocations
pytest支持验证,因为可以将mockito与pytest一起使用。pytest不提供模拟库。在
特别是,由于mockito的VerificationError是AssertionError的子类,如果验证失败,用pytest运行的测试将相应地失败。在
VerificationError
AssertionError
>>> isinstance(mockito.VerificationError(), AssertionError) True
pytest支持验证,因为可以将mockito与pytest一起使用。pytest不提供模拟库。在
特别是,由于mockito的
VerificationError
是AssertionError
的子类,如果验证失败,用pytest运行的测试将相应地失败。在相关问题 更多 >
编程相关推荐