Update tests/test_utils_shortcut.py
Run CI Tests / test (push) Successful in 1m2s

This commit is contained in:
2025-08-05 22:59:47 +02:00
parent 7b07851992
commit caa971cdc8
+4 -4
View File
@@ -23,7 +23,7 @@ class TestShortcutInitialization:
assert sc.name == "addition fct"
assert sc.func(2, 3) == 5
def test_run_method(self, capsys):
def test_run_method(capsys):
# Test direct execution while verifying print output
execution_results = []
@@ -49,7 +49,7 @@ def test_run_method(self, capsys):
task = sc.run(hold=True)
assert task.hold is True
def test_repr_output(self):
def test_repr_output():
# Test exact __repr__ format
def my_func():
pass
@@ -57,7 +57,7 @@ def test_repr_output(self):
sc = Shortcut(my_func, name="Test Repr")
assert repr(sc) == f"Shortcut \"Test Repr\""
def test_source_with_regular_function(self):
def test_source_with_regular_function():
# Test source with normal function
def example():
a = 1
@@ -72,7 +72,7 @@ def test_source_with_regular_function(self):
assert "return a + b" in src
@patch('inspect.getsource')
def test_source_error_handling(self, mock_getsource):
def test_source_error_handling(mock_getsource):
# Test exception handling when inspect fails
mock_getsource.side_effect = OSError("No source")
sc = Shortcut(lambda x: x)