Skip to content

πŸ™Œ OpenHands: AI-Driven Development

(fix) split_bash_commands replaced; temp_dir fixture fix in some tests (#3160)

tobitege2533efabbb5f
diff --git a/tests/unit/test_event_stream.py b/tests/unit/test_event_stream.py
index 4c7754c43f..a07c9c791c 100644
--- a/tests/unit/test_event_stream.py
+++ b/tests/unit/test_event_stream.py
@@ -16,7 +16,7 @@ from opendevin.storage import get_file_store
def temp_dir(monkeypatch):
# get a temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
- pathlib.Path().mkdir(parents=True, exist_ok=True)
+ pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
yield temp_dir
diff --git a/tests/unit/test_ipython.py b/tests/unit/test_ipython.py
index f1444a5ee8..66a03cc03a 100644
--- a/tests/unit/test_ipython.py
+++ b/tests/unit/test_ipython.py
@@ -14,7 +14,7 @@ from opendevin.runtime.server.runtime import ServerRuntime
def temp_dir(monkeypatch):
# get a temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
- pathlib.Path().mkdir(parents=True, exist_ok=True)
+ pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
yield temp_dir
diff --git a/tests/unit/test_runtime.py b/tests/unit/test_runtime.py
index dc64ae7ecd..4810481ec3 100644
--- a/tests/unit/test_runtime.py
+++ b/tests/unit/test_runtime.py
@@ -44,7 +44,7 @@ def print_method_name(request):
def temp_dir(monkeypatch):
# get a temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
- pathlib.Path().mkdir(parents=True, exist_ok=True)
+ pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
yield temp_dir
diff --git a/tests/unit/test_sandbox.py b/tests/unit/test_sandbox.py
index dd78fef4c9..c6e57bb2e3 100644
--- a/tests/unit/test_sandbox.py
+++ b/tests/unit/test_sandbox.py
@@ -32,11 +32,18 @@ def create_docker_box_from_app_config(
)
[email protected](autouse=True)
+def print_method_name(request):
+ print('\n########################################################################')
+ print(f'Running test: {request.node.name}')
+ print('########################################################################')
+
+
@pytest.fixture
def temp_dir(monkeypatch):
# get a temporary directory
with tempfile.TemporaryDirectory() as temp_dir:
- pathlib.Path().mkdir(parents=True, exist_ok=True)
+ pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
yield temp_dir