Skip to content

Commit

Permalink
FIX: Use relative tolerance in test_tic_tac_toc (#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad authored and mmcky committed Aug 25, 2017
1 parent 1389f5e commit 2814190
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions quantecon/util/tests/test_timing.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
Authors: Pablo Winant
Tests for timing.py
"""
from numpy.testing import assert_allclose


def test_tic_tac_toc():

Expand All @@ -22,9 +24,9 @@ def test_tic_tac_toc():
time.sleep(h)
el3 = toc()

assert(abs(el1-h)<0.01)
assert(abs(el2-h)<0.01)
assert(abs(el3-h*3)<0.01)
rtol = 0.1
for actual, desired in zip([el1, el2, el3], [h, h, h*3]):
assert_allclose(actual, desired, rtol=rtol)


if __name__ == "__main__":
Expand Down

0 comments on commit 2814190

Please sign in to comment.