Skip to content

πŸ™Œ OpenHands: AI-Driven Development

Fix agentskills tests (#2242)

tobitege44bbe5e208cd
diff --git a/tests/unit/test_agent_skill.py b/tests/unit/test_agent_skill.py
index 3c5f426a0d..9edfc5d26b 100644
--- a/tests/unit/test_agent_skill.py
+++ b/tests/unit/test_agent_skill.py
@@ -22,12 +22,21 @@ from opendevin.runtime.plugins.agent_skills.agentskills import (
)
+# CURRENT_FILE must be reset for each test
[email protected](autouse=True)
+def reset_current_file():
+ from opendevin.runtime.plugins.agent_skills import agentskills
+
+ agentskills.CURRENT_FILE = None
+
+
def test_open_file_unexist_path():
with pytest.raises(FileNotFoundError):
open_file('/unexist/path/a.txt')
def test_open_file(tmp_path):
+ assert tmp_path is not None
temp_file_path = tmp_path / 'a.txt'
temp_file_path.write_text('Line 1\nLine 2\nLine 3\nLine 4\nLine 5')