]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
Explain the return value of m_time
authorZack Cerza <zack@redhat.com>
Tue, 7 Jun 2016 23:39:53 +0000 (17:39 -0600)
committerZack Cerza <zack@redhat.com>
Tue, 7 Jun 2016 23:39:53 +0000 (17:39 -0600)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/suite/test/test_init.py

index 84c929de8d5bc791809f6f3534cb2896d20d5034..6c576627362d7e9ca71e62b6b1a5528b5176fed5 100644 (file)
@@ -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()