From f058f74ec85f5ce0f42da6f4261ebc5b2f25847a Mon Sep 17 00:00:00 2001 From: drew2a Date: Tue, 27 Jun 2023 16:08:22 +0200 Subject: [PATCH] Adjust `test_show_system_popup_win` to accommodate multiple runs. --- src/tribler/core/utilities/tests/test_utilities.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/tribler/core/utilities/tests/test_utilities.py b/src/tribler/core/utilities/tests/test_utilities.py index 6f848f3bd95..bcc864f2871 100644 --- a/src/tribler/core/utilities/tests/test_utilities.py +++ b/src/tribler/core/utilities/tests/test_utilities.py @@ -198,7 +198,7 @@ def test_show_system_popup_win(): # In case of *nix machine, "@patch_import(modules=['win32api'], MessageBox=MagicMock())" will work. # In case of win machine, "with patch('win32api.MessageBox'):" will work. # - # No matter what kind of Mock was used, the line "win32api.MessageBox.assert_called_once()" should work. + # No matter what kind of Mock was used, the line "win32api.MessageBox.assert_called_with()" should work. # # This approach also applies to the test functions below. @@ -206,7 +206,7 @@ def test_show_system_popup_win(): with patch('win32api.MessageBox'): # this patch starts to work only in case win32api exists on the target machine show_system_popup('title', 'text') - win32api.MessageBox.assert_called_once_with(0, 'text', 'title') + win32api.MessageBox.assert_called_with(0, 'text', 'title') @patch_import(modules=['subprocess'], Popen=MagicMock())