Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
Signed-off-by: BryceGattis <[email protected]>
  • Loading branch information
BryceGattis committed Jul 14, 2024
1 parent 829873c commit 42402fa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/rez/tests/test_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 42402fa

Please sign in to comment.