From 5a153691fd580c3d2d4e851dbe6f5b5e0bc68bd0 Mon Sep 17 00:00:00 2001 From: mikkkee Date: Fri, 7 Jul 2023 20:08:33 +0800 Subject: [PATCH] Fix test timeout error --- tests/test_graphical.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/test_graphical.py b/tests/test_graphical.py index 7cbb1e9..356fc85 100755 --- a/tests/test_graphical.py +++ b/tests/test_graphical.py @@ -1,4 +1,5 @@ import pytest +from unittest import mock from conftest import ac, anki_version, wait_until, \ close_all_dialogs_and_wait_for_them_to_run_closing_callbacks, \ @@ -30,7 +31,9 @@ def test_guiDeckOverview(setup): def test_guiImportFile(setup): if anki_version >= (2, 1, 52): - ac.guiImportFile() + with mock.patch('aqt.import_export.importing.prompt_for_file_then_import') as mock_prompt_for_file_then_import: + mock_prompt_for_file_then_import.return_value = True + ac.guiImportFile() class TestAddCards: