1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2025-01-22 05:10:56 +00:00

chore(python): improve recovery type deprecation warning

This commit is contained in:
matejcik 2024-07-19 15:26:10 +02:00 committed by M1nd3r
parent 84292a66b4
commit 38395c16ce
4 changed files with 9 additions and 5 deletions

View File

@ -175,6 +175,7 @@ def recover(
warnings.warn( warnings.warn(
"Use type=RecoveryType.DryRun instead!", "Use type=RecoveryType.DryRun instead!",
DeprecationWarning, DeprecationWarning,
stacklevel=3,
) )
if type is not None: if type is not None:

View File

@ -92,7 +92,10 @@ def test_invalid_seed_core(client: Client):
IF = InputFlowBip39RecoveryDryRunInvalid(client) IF = InputFlowBip39RecoveryDryRunInvalid(client)
client.set_input_flow(IF.get()) client.set_input_flow(IF.get())
with pytest.raises(exceptions.Cancelled): with pytest.raises(exceptions.Cancelled):
return device.recover(client, dry_run=True) return device.recover(
client,
type=messages.RecoveryType.DryRun,
)
@pytest.mark.setup_client(uninitialized=True) @pytest.mark.setup_client(uninitialized=True)

View File

@ -50,7 +50,7 @@ def test_2of3_dryrun(client: Client):
passphrase_protection=False, passphrase_protection=False,
pin_protection=False, pin_protection=False,
label="label", label="label",
dry_run=True, type=messages.RecoveryType.DryRun,
) )
# Dry run was successful # Dry run was successful
@ -74,5 +74,5 @@ def test_2of3_invalid_seed_dryrun(client: Client):
passphrase_protection=False, passphrase_protection=False,
pin_protection=False, pin_protection=False,
label="label", label="label",
dry_run=True, type=messages.RecoveryType.DryRun,
) )

View File

@ -46,7 +46,7 @@ def test_2of3_dryrun(client: Client):
passphrase_protection=False, passphrase_protection=False,
pin_protection=False, pin_protection=False,
label="label", label="label",
dry_run=True, type=messages.RecoveryType.DryRun,
) )
# Dry run was successful # Dry run was successful
@ -70,5 +70,5 @@ def test_2of3_invalid_seed_dryrun(client: Client):
passphrase_protection=False, passphrase_protection=False,
pin_protection=False, pin_protection=False,
label="label", label="label",
dry_run=True, type=messages.RecoveryType.DryRun,
) )