From 42402fa3dc07e679fecab6be7f3d86de94bdee9f Mon Sep 17 00:00:00 2001 From: BryceGattis Date: Sun, 14 Jul 2024 12:11:38 -0500 Subject: [PATCH] Fix broken test Signed-off-by: BryceGattis --- src/rez/tests/test_context.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/rez/tests/test_context.py b/src/rez/tests/test_context.py index f2bbff7ad..2c1993f71 100644 --- a/src/rez/tests/test_context.py +++ b/src/rez/tests/test_context.py @@ -283,10 +283,9 @@ def solver_callback(solver_state: SolverState): callback = ResolvedContext.Callback(max_fails=999, time_limit=0, callback=solver_callback, buf=sys.stdout) solve_state = SolverState(3, 1, None) - # TODO: Can't seem to get this mock to work for some reason. - # Mock start time to be Jan 1, 1970. - with unittest.mock.patch('rez.resolved_context.ResolvedContext.Callback.start_time', - new_callable=unittest.mock.PropertyMock, return_value=0): + with unittest.mock.patch('rez.resolved_context.ResolvedContext.Callback') as mock_callback: + # Mock start time to be Jan 1, 1970. + mock_callback.start_time.return_value = 0 callback_result = callback(solve_state) assert callback_result[0] == SolverCallbackReturn.abort