presubmit_unittest: Mock time_time for ThreadPoolTest

Mock time_time so that time.time is not called from ThreadPoolTest tests,
so that the execution time doesn't change between executions.

Bug: 1047631
Change-Id: I4f4ac30ca6a2ee3be25830c0e17a9f29a9c0c999
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2036477
Reviewed-by: Anthony Polito <apolito@google.com>
Commit-Queue: Edward Lesmes <ehmaldonado@chromium.org>
changes/77/2036477/2
Edward Lemur 5 years ago committed by LUCI CQ
parent e4d329cc00
commit d7c06ac64d

@ -3033,6 +3033,7 @@ class ThreadPoolTest(unittest.TestCase):
super(ThreadPoolTest, self).setUp()
mock.patch('subprocess2.Popen').start()
mock.patch('presubmit_support.sigint_handler').start()
mock.patch('presubmit_support.time_time', return_value=0).start()
presubmit.sigint_handler.wait.return_value = ('stdout', '')
self.addCleanup(mock.patch.stopall)

Loading…
Cancel
Save