diff --git a/tests/test_utils_shortcut.py b/tests/test_utils_shortcut.py index 8223d78b9..f10d9861e 100644 --- a/tests/test_utils_shortcut.py +++ b/tests/test_utils_shortcut.py @@ -2,11 +2,17 @@ import pytest import inspect from unittest.mock import MagicMock, patch from textwrap import dedent - from slic.utils.shortcut import Shortcut, as_shortcut, shortcuts, Registry -# Tests for Shortcut class +@pytest.fixture(autouse=True) +def reset_shortcuts(): + # Reset shortcuts before each test + shortcuts._instance = None + yield + shortcuts._instance = None + +# Tests for Shortcut class class TestShortcutInitialization: def test_init_with_custom_name(self): # Verify initialization with custom name @@ -44,10 +50,7 @@ def test_run_method(capsys): # Verify Task properties assert task.func == sample assert task.func() == "ok" - assert task.hold is False - - task = sc.run(hold=True) - assert task.hold is True + assert task.status == "done" def test_repr_output(): # Test exact __repr__ format