From 697b1e0d037cca36f921420e47b55a42ddcd1e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Thu, 23 May 2024 14:36:33 +0200 Subject: [PATCH] chore: mark some lines as unreachable for mypy --- tests/gui/test_updater.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/gui/test_updater.py b/tests/gui/test_updater.py index 8572ad7..d18eebe 100644 --- a/tests/gui/test_updater.py +++ b/tests/gui/test_updater.py @@ -247,14 +247,14 @@ def test_update_checks_cooldown(updater: UpdaterThread, mocker: MockerFixture) - report = updater.check_for_updates() assert cooldown_spy.spy_return is True - assert updater.dangerzone.settings.get("updater_last_check") == curtime - 1 + assert updater.dangerzone.settings.get("updater_last_check") == curtime - 1 # type: ignore [unreachable] assert_report_equal(report, UpdateReport()) # Test 3: Advance the current time by seconds. Ensure that # Dangerzone checks for updates again, and the last check timestamp gets bumped. curtime += updater_module.UPDATE_CHECK_COOLDOWN_SECS timestamp_mock.return_value = curtime - requests_mock.side_effect = None # type: ignore [attr-defined] + requests_mock.side_effect = None report = updater.check_for_updates() assert cooldown_spy.spy_return is False @@ -269,7 +269,7 @@ def test_update_checks_cooldown(updater: UpdaterThread, mocker: MockerFixture) - curtime += updater_module.UPDATE_CHECK_COOLDOWN_SECS timestamp_mock.return_value = curtime - requests_mock.side_effect = Exception("failed") # type: ignore [attr-defined] + requests_mock.side_effect = Exception("failed") report = updater.check_for_updates() assert cooldown_spy.spy_return is False @@ -406,11 +406,11 @@ def test_update_check_prompt( # Test 3 - Same as the previous test, but check that clicking on cancel stores the # opposite decision. - qt_updater.check = None + qt_updater.check = None # type: ignore [unreachable] def click_cancel() -> None: dialog = qt_updater.dangerzone.app.activeWindow() - dialog.cancel_button.click() # type: ignore [attr-defined] + dialog.cancel_button.click() QtCore.QTimer.singleShot(500, click_cancel) res = qt_updater.should_check_for_updates()