From d11c074a859b6bcef05cad8a3947bd09651608ec Mon Sep 17 00:00:00 2001 From: Eric Masseran Date: Mon, 10 Nov 2025 23:44:02 +0100 Subject: [PATCH] Improve test to not sleep --- test/plugins/test_embedart.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/plugins/test_embedart.py b/test/plugins/test_embedart.py index ae66fbc6f..2b6f59e26 100644 --- a/test/plugins/test_embedart.py +++ b/test/plugins/test_embedart.py @@ -17,7 +17,6 @@ import os import os.path import shutil import tempfile -import time import unittest from unittest.mock import MagicMock, patch @@ -229,21 +228,19 @@ class EmbedartCliTest( item = album.items()[0] self.io.addinput("y") self.run_command("embedart", "-f", self.small_artpath) - embedded_time = item.current_mtime() - time.sleep(1) + embedded_time = os.path.getmtime(syspath(item.path)) self.io.addinput("y") self.run_command("clearart") mediafile = MediaFile(syspath(item.path)) assert not mediafile.images - clear_time = item.current_mtime() + clear_time = os.path.getmtime(syspath(item.path)) assert clear_time > embedded_time - time.sleep(1) # A run on a file without an image should not be modified self.io.addinput("y") self.run_command("clearart") - no_clear_time = item.current_mtime() + no_clear_time = os.path.getmtime(syspath(item.path)) assert no_clear_time == clear_time def test_clear_art_with_no_input(self):