提交 e54c5c77 authored 作者: notoraptor's avatar notoraptor

Make utt.assert_allclose() interface more clear

(to help specify expected value vs given value)
上级 0bc0216c
......@@ -352,9 +352,9 @@ class WrongValue(Exception):
return s + str_diagnostic(self.val1, self.val2, self.rtol, self.atol)
def assert_allclose(val1, val2, rtol=None, atol=None):
if not T.basic._allclose(val1, val2, rtol, atol):
raise WrongValue(val1, val2, rtol, atol)
def assert_allclose(expected, value, rtol=None, atol=None):
if not T.basic._allclose(expected, value, rtol, atol):
raise WrongValue(expected, value, rtol, atol)
class AttemptManyTimes:
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论