Skip to content

Commit

Permalink
fix: use monkeypatch
Browse files Browse the repository at this point in the history
  • Loading branch information
vgorkavenko committed Feb 12, 2025
1 parent c5bc4a9 commit 1b3caa4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ def test_get_nearest_and_distant_blockstamps(
],
)
def test_calculate_cl_rebase_between_blocks(
monkeypatch,
web3,
prev_lido_validators,
curr_lido_validators,
Expand All @@ -363,7 +364,12 @@ def test_calculate_cl_rebase_between_blocks(
abnormal_case.w3.lido_contracts = Mock()
abnormal_case.w3.cc.get_validators_no_cache = Mock()

LidoValidatorsProvider.merge_validators_with_keys = Mock(return_value=prev_lido_validators)
with monkeypatch.context():
monkeypatch.setattr(
LidoValidatorsProvider,
"merge_validators_with_keys",
Mock(return_value=prev_lido_validators),
)
abnormal_case.lido_validators = curr_lido_validators
abnormal_case.w3.lido_contracts.get_withdrawal_balance_no_cache = Mock(
side_effect=[curr_withdrawals_vault_balance, prev_withdrawals_vault_balance]
Expand Down

0 comments on commit 1b3caa4

Please sign in to comment.