test(core/eckhart): simplify "Backup failed" notification test
What changed, and why it matters
This commit only changes an automated test for the Trezor hardware wallet. It simplifies how the test puts the device into a 'backup failed' state by starting from a pre-configured test fixture instead of manually running and cancelling a backup. No actual wallet firmware code or user-facing behavior is changed.
No security action needed; this is a test-only refactor.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The diff modifies tests/click_tests/device_menu/test_notifications.py to replace a runtime backup-and-cancel sequence with a pytest fixture marker (@pytest.mark.setup_client(unfinished_backup=True)). It also updates the corresponding UI test fixture hashes in tests/ui_tests/fixtures.json because the on-screen flow now differs. The change is purely test-code refactoring.
Changed components
tests/click_tests/device_menu/test_notifications.pytests/ui_tests/fixtures.jsonInspect captured patch +10 / −42
diff --git a/tests/click_tests/device_menu/test_notifications.py b/tests/click_tests/device_menu/test_notifications.py
index c29b6b10..addfb235 100644
--- a/tests/click_tests/device_menu/test_notifications.py
+++ b/tests/click_tests/device_menu/test_notifications.py
@@ -18,11 +18,9 @@ from typing import TYPE_CHECKING
import pytest
-from trezorlib import device, messages
-from trezorlib.exceptions import Cancelled
+from trezorlib import messages
from ... import translations as TR
-from .. import reset
from ..test_pin import PIN4, _assert_pin_entry, _enter_two_times
from .common import (
Menu,
@@ -125,7 +123,7 @@ def test_seedless(device_handler: "BackgroundDeviceHandler"):
menu_idx(backup_notification, layout.vertical_menu_content())
-@pytest.mark.setup_client(needs_backup=True)
+@pytest.mark.setup_client(unfinished_backup=True)
def test_backup_failed(
device_handler: "BackgroundDeviceHandler",
):
@@ -133,38 +131,8 @@ def test_backup_failed(
debug = device_handler.debuglink()
assert features.initialized is True
- assert features.unfinished_backup is False
- assert features.backup_availability == messages.BackupAvailability.Required
-
- # Spawn the backup process and cancel it
- session = device_handler.client.get_seedless_session()
- device_handler.run_with_provided_session(
- session,
- device.backup,
- )
-
- # confirm backup configuration
- debug.synchronize_at("TextScreen")
- assert TR.regexp("backup__info_single_share_backup").match(
- debug.read_layout().text_content()
- )
- reset.confirm_read(debug)
-
- # confirm backup intro
- assert TR.reset__never_make_digital_copy in debug.read_layout().text_content()
- reset.confirm_read(debug, middle_r=True)
-
- # read words
- reset.read_words(debug, do_htc=False, confirm_instruction=True)
- # stop at words' confirmation
- debug.synchronize_at("SelectWordScreen")
-
- device_handler.kill_task()
- # the transport is closed by `kill_task` above
- session.client.transport.open()
- # Raise the loop restart exception to reset the flow
- with pytest.raises(Cancelled):
- session.call(messages.Cancel())
+ assert features.unfinished_backup is True
+ assert features.backup_availability is messages.BackupAvailability.NotAvailable
# Wait for the homescreen to appear
debug.synchronize_at("Homescreen")
diff --git a/tests/ui_tests/fixtures.json b/tests/ui_tests/fixtures.json
index c5fedf36..d27a4137 100644
--- a/tests/ui_tests/fixtures.json
+++ b/tests/ui_tests/fixtures.json
@@ -30074,7 +30074,7 @@
"T3W1_cs_device_menu-test_label.py::test_label_loop_all_categories": "051e1bfecb3b7d9557ff2a67269d0e5479b2e2cf60e6ac4c43d3c10027ab8786",
"T3W1_cs_device_menu-test_label.py::test_label_over_32_chars": "e5cb85212c002fc32c322675a0f748195a83c6d81c9f47844f6e5b56eedae02b",
"T3W1_cs_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_cs_device_menu-test_notifications.py::test_backup_failed": "0ef6f0312ee49c0205ee0382d396744b0a8a9388be0123a17404fad68f092ac0",
+"T3W1_cs_device_menu-test_notifications.py::test_backup_failed": "9dd166fae55494315e1db21141dac2d499cff0f897c6a5041588097aa7288036",
"T3W1_cs_device_menu-test_notifications.py::test_backup_needed": "3e9219faf28dc045827113d9a0ebec8e42437bc39cb3e437cbdb6b3992e89538",
"T3W1_cs_device_menu-test_notifications.py::test_pin_not_set": "07ab9a8e684aff43028cd23cbfbe162940b89c58144035c1b0a0924fe62213a8",
"T3W1_cs_device_menu-test_notifications.py::test_seedless": "f47325f31b7cff66ad1ed9a2d98659b7161306440ae40e503ceac2407f8ffa92",
@@ -30178,7 +30178,7 @@
"T3W1_de_device_menu-test_label.py::test_label_loop_all_categories": "4cc195e8c7e0b81cf82708e516314fc3fd9fcaa3b5b588000e776e6a79641d34",
"T3W1_de_device_menu-test_label.py::test_label_over_32_chars": "3d86ece3a0ad16056ee1fdd68714be4da8e9023d817e13cd8a57d6c781eb1808",
"T3W1_de_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_de_device_menu-test_notifications.py::test_backup_failed": "aef61818bdee4606ff49310b7ad4980a044d5322197d2f9a19e90685afef264b",
+"T3W1_de_device_menu-test_notifications.py::test_backup_failed": "7c5786a6c108734bb2d9819b5ccf1f0cdeb86e49e05a5d7a049feb7ee1fea447",
"T3W1_de_device_menu-test_notifications.py::test_backup_needed": "cfca9b9cb3a21b721826a0abae315f2a46887f3aa04d654c46b03822a9c4affe",
"T3W1_de_device_menu-test_notifications.py::test_pin_not_set": "2038d38f5cb74f981a221901b597e5119851a0f68895bc5265c0a7e169b2bda5",
"T3W1_de_device_menu-test_notifications.py::test_seedless": "a9d5623f79e78ef37c9ddd13b5fbb101addfd58b2c285d65a80e5e4074282b8b",
@@ -30282,7 +30282,7 @@
"T3W1_en_device_menu-test_label.py::test_label_loop_all_categories": "78361dd3ce1478cfccfa4779827dba4220e05eebe9a5fb6f07f3441be8baa1c4",
"T3W1_en_device_menu-test_label.py::test_label_over_32_chars": "ca67fd0ded3fc9289e6b7790b2e1e444660a304b2f223e964e200c6c18056c92",
"T3W1_en_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_en_device_menu-test_notifications.py::test_backup_failed": "8b37579c1c4f0cd0cca690c40bcb5e486eddc7887c6d23d069c1a05a41f194b0",
+"T3W1_en_device_menu-test_notifications.py::test_backup_failed": "aa413ac75b5aa8eed4443434ac17c2d51bc8de271de8f5d4e17cf8ab27d5420c",
"T3W1_en_device_menu-test_notifications.py::test_backup_needed": "110d3832f3581896f926f20a84201be89efea5040d7cb89bdb5a9e7b85182e45",
"T3W1_en_device_menu-test_notifications.py::test_pin_not_set": "c403173033c867b91bb27401eeb5eff56f97f803d83abca533db71327df0fac9",
"T3W1_en_device_menu-test_notifications.py::test_seedless": "49d1a24f6f35086b8819dca2e26593e4dbe921bfdc8e4af1ee44f6e71fd14a4c",
@@ -30386,7 +30386,7 @@
"T3W1_es_device_menu-test_label.py::test_label_loop_all_categories": "a5c3934ed6e2088689e293d145680df49b644c0da8d44fca1391329a575ef4e6",
"T3W1_es_device_menu-test_label.py::test_label_over_32_chars": "2c3afc368b645bd9c5097d35348269c9fe2287cda03076f59f455a4da01a5014",
"T3W1_es_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_es_device_menu-test_notifications.py::test_backup_failed": "01a8e6de42861a5ac2f9150c6c78e68acaa68203e3c1cd737df740fa6e2eac7e",
+"T3W1_es_device_menu-test_notifications.py::test_backup_failed": "163769b824efc89a1a22af5e2256391e1b1fcf89b2e85a5a6869afe5285c864e",
"T3W1_es_device_menu-test_notifications.py::test_backup_needed": "04d677c84f107c88aaafefe12309ebcb936a398b3538412ea32af16115c820df",
"T3W1_es_device_menu-test_notifications.py::test_pin_not_set": "ba6cc6141c8bc52df26f7aafe78902cf008267ee478c923c709f993b9334e1c7",
"T3W1_es_device_menu-test_notifications.py::test_seedless": "cfdfa08a44a910030e48afb3c1c4cdfc19f50410e1ecfba490a802671c44006d",
@@ -30490,7 +30490,7 @@
"T3W1_fr_device_menu-test_label.py::test_label_loop_all_categories": "f1e0446b5ac19b9fc6a69cca52dddede88413beaa586d24a47ac31c72fe7f3ac",
"T3W1_fr_device_menu-test_label.py::test_label_over_32_chars": "82915e5537e2fa32286d85568698787b0a898673dfe0dfba07cf0488011625db",
"T3W1_fr_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_fr_device_menu-test_notifications.py::test_backup_failed": "6f460eca18e0c0d76e36737dffba0768f63c7ba887a234df617b327a911f0795",
+"T3W1_fr_device_menu-test_notifications.py::test_backup_failed": "b7364a982f46d26e846ee3ac17e9526e3bcffb8e66a5d597e7bdd08b8ae5ee4c",
"T3W1_fr_device_menu-test_notifications.py::test_backup_needed": "55f2d653365928a4598ac9f4cb769dc4d72558d50011f5e27ecfa11ec1ef763e",
"T3W1_fr_device_menu-test_notifications.py::test_pin_not_set": "997a2e8720c5e6d49adf11d2354a720559b6b9248dc38719c87bed610dcbc09e",
"T3W1_fr_device_menu-test_notifications.py::test_seedless": "e6dd2332fbc9992e5418d109ba6d3b9089712500dc0ba9cb4a33fcf3d91ba552",
@@ -30594,7 +30594,7 @@
"T3W1_pt_device_menu-test_label.py::test_label_loop_all_categories": "d812249061da5d3aacb75076593e469000176275d79d75098d753f590670592e",
"T3W1_pt_device_menu-test_label.py::test_label_over_32_chars": "649037162972769a0285490cfaefb5929bc7e2f270ca2e1bb10a13b72c982fbf",
"T3W1_pt_device_menu-test_label.py::test_label_uninitialized": "987d1c62e6576b9cc24373e00df522efdc9736af978d6032f7d319af8daaef5d",
-"T3W1_pt_device_menu-test_notifications.py::test_backup_failed": "537e9d853886ae88507fc66781fc61e14ab0ee76257a084ebc4c5f7e32b48411",
+"T3W1_pt_device_menu-test_notifications.py::test_backup_failed": "51df1c22e3dc350f8902fabfa1d34268de71f79aa5e9c3d18e1be930825befbb",
"T3W1_pt_device_menu-test_notifications.py::test_backup_needed": "29bc804809d98b87ecb26b473ae96585859e4f85cc9704c346531a312e27ef3b",
"T3W1_pt_device_menu-test_notifications.py::test_pin_not_set": "2a30c1c2560a84a8962b0b694310cd279f8bd6fffa9bb8ebafe6586eb27eb241",
"T3W1_pt_device_menu-test_notifications.py::test_seedless": "d56d15858d2640e216e8e87b56470f942dcb4d2c55a3b45da3bbed17e28c16cd",
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.