From: Zack Cerza Date: Tue, 7 Jun 2016 23:39:53 +0000 (-0600) Subject: Explain the return value of m_time X-Git-Tag: 1.1.0~603^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=192da6f307201ae89beef2a5fb7aa89f81ee5eda;p=teuthology.git Explain the return value of m_time Signed-off-by: Zack Cerza --- diff --git a/teuthology/suite/test/test_init.py b/teuthology/suite/test/test_init.py index 84c929de8..6c5766273 100644 --- a/teuthology/suite/test/test_init.py +++ b/teuthology/suite/test/test_init.py @@ -13,6 +13,12 @@ import time def get_fake_time_and_sleep(): + # Below we set m_time.side_effect, but we also set m_time.return_value. + # The reason for this is that we need to store a 'fake time' that + # increments when m_sleep() is called; we could use any variable name we + # wanted for the return value, but since 'return_value' is already a + # standard term in mock, and since setting side_effect causes return_value + # to be ignored, it's safe to just reuse the name here. m_time = Mock() m_time.return_value = time.time()