diff --git a/src/seedsigner/views/seed_views.py b/src/seedsigner/views/seed_views.py index cad143de..c2458ee7 100644 --- a/src/seedsigner/views/seed_views.py +++ b/src/seedsigner/views/seed_views.py @@ -707,10 +707,8 @@ class SeedExportXpubDetailsView(View): selected_menu_num = 0 else: - # imported locally instead of at module level to avoid flow-test warnings: "comparing int to MagicMock" - from seedsigner.gui.screens.screen import LoadingScreenThread - # The derivation calc takes a few moments. Run the loading screen while we wait. + from seedsigner.gui.screens.screen import LoadingScreenThread self.loading_screen = LoadingScreenThread(text="Generating xpub...") self.loading_screen.start() diff --git a/tests/base.py b/tests/base.py index fb8f1bca..78d3c61a 100644 --- a/tests/base.py +++ b/tests/base.py @@ -26,7 +26,7 @@ class BaseTest: # Ensure there are no on-disk artifacts after running tests. Settings.SETTINGS_FILENAME = "settings-test.json" - # Mock out the loading screen so it can't spawn. + # Mock out the loading screen so it can't spawn. View classes must import locally! patch('seedsigner.gui.screens.screen.LoadingScreenThread').start() diff --git a/tests/test_flows_seed.py b/tests/test_flows_seed.py index 7090e2fd..18628f1e 100644 --- a/tests/test_flows_seed.py +++ b/tests/test_flows_seed.py @@ -96,7 +96,7 @@ class TestSeedFlows(FlowTest): Selecting "Export XPUB" from the SeedOptionsView should enter the Export XPUB flow and end at the MainMenuView """ - def test_standard_xpubs(sig_tuple, script_tuple, coord_tuple): + def flowtest_standard_xpub(sig_tuple, script_tuple, coord_tuple): self.run_sequence( initial_destination_view_args=dict(seed_num=0), sequence=[ @@ -116,10 +116,10 @@ class TestSeedFlows(FlowTest): self.controller.storage.set_pending_seed(Seed(mnemonic=mnemonic)) self.controller.storage.finalize_pending_seed() - # these are (constant_value, display_name) tuples - sig_types = SettingsConstants.ALL_SIG_TYPES - script_types = SettingsConstants.ALL_SCRIPT_TYPES - coordinators = SettingsConstants.ALL_COORDINATORS + # these are lists of (constant_value, display_name) tuples + sig_types: list[tuple[str, str]] = SettingsConstants.ALL_SIG_TYPES + script_types: list[tuple[str, str]] = SettingsConstants.ALL_SCRIPT_TYPES + coordinators: list[tuple[str, str]] = SettingsConstants.ALL_COORDINATORS # enable non-defaults so they're available in views self.settings.set_value(SettingsConstants.SETTING__SIG_TYPES, [x for x,y in sig_types]) @@ -138,7 +138,7 @@ class TestSeedFlows(FlowTest): continue else: print('\n\ntest_standard_xpubs(%s, %s, %s)' % (sig_tuple, script_tuple, coord_tuple)) - test_standard_xpubs(sig_tuple, script_tuple, coord_tuple) + flowtest_standard_xpub(sig_tuple, script_tuple, coord_tuple) def test_export_xpub_disabled_not_available_flow(self): @@ -150,10 +150,10 @@ class TestSeedFlows(FlowTest): self.controller.storage.set_pending_seed(Seed(mnemonic=mnemonic)) self.controller.storage.finalize_pending_seed() - # these are (constant_value, display_name) tuples - sig_types = SettingsConstants.ALL_SIG_TYPES - script_types = SettingsConstants.ALL_SCRIPT_TYPES - coordinators = SettingsConstants.ALL_COORDINATORS + # these are lists of (constant_value, display_name) tuples + sig_types: list[tuple[str, str]] = SettingsConstants.ALL_SIG_TYPES + script_types: list[tuple[str, str]] = SettingsConstants.ALL_SCRIPT_TYPES + coordinators: list[tuple[str, str]] = SettingsConstants.ALL_COORDINATORS # these are the disabled types that we will be testing disabled_sig = SettingsConstants.MULTISIG