We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ce3b756 commit 701a64fCopy full SHA for 701a64f
test/functional/test_framework/util.py
@@ -29,6 +29,10 @@
29
30
def assert_approx(v, vexp, vspan=0.00001):
31
"""Assert that `v` is within `vspan` of `vexp`"""
32
+ if isinstance(v, Decimal) or isinstance(vexp, Decimal):
33
+ v=Decimal(v)
34
+ vexp=Decimal(vexp)
35
+ vspan=Decimal(vspan)
36
if v < vexp - vspan:
37
raise AssertionError("%s < [%s..%s]" % (str(v), str(vexp - vspan), str(vexp + vspan)))
38
if v > vexp + vspan:
0 commit comments