Skip to content

Commit 2533efa

Browse files
authored
(fix) split_bash_commands replaced; temp_dir fixture fix in some tests (OpenHands#3160)
* split_bash_commands replaced; temp_dir fixture fix in some tests * tweak test_runtime * skip 2 tests in test_runtime that need fixing in extra PR * reverting bash parsing changes and re-enabled tests * missed to revert a changed assert in test_runtime.py
1 parent 7cefd32 commit 2533efa

4 files changed

Lines changed: 11 additions & 4 deletions

File tree

tests/unit/test_event_stream.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def temp_dir(monkeypatch):
1717
# get a temporary directory
1818
with tempfile.TemporaryDirectory() as temp_dir:
19-
pathlib.Path().mkdir(parents=True, exist_ok=True)
19+
pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
2020
yield temp_dir
2121

2222

tests/unit/test_ipython.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
def temp_dir(monkeypatch):
1515
# get a temporary directory
1616
with tempfile.TemporaryDirectory() as temp_dir:
17-
pathlib.Path().mkdir(parents=True, exist_ok=True)
17+
pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
1818
yield temp_dir
1919

2020

tests/unit/test_runtime.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ def print_method_name(request):
4444
def temp_dir(monkeypatch):
4545
# get a temporary directory
4646
with tempfile.TemporaryDirectory() as temp_dir:
47-
pathlib.Path().mkdir(parents=True, exist_ok=True)
47+
pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
4848
yield temp_dir
4949

5050

tests/unit/test_sandbox.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,18 @@ def create_docker_box_from_app_config(
3232
)
3333

3434

35+
@pytest.fixture(autouse=True)
36+
def print_method_name(request):
37+
print('\n########################################################################')
38+
print(f'Running test: {request.node.name}')
39+
print('########################################################################')
40+
41+
3542
@pytest.fixture
3643
def temp_dir(monkeypatch):
3744
# get a temporary directory
3845
with tempfile.TemporaryDirectory() as temp_dir:
39-
pathlib.Path().mkdir(parents=True, exist_ok=True)
46+
pathlib.Path(temp_dir).mkdir(parents=True, exist_ok=True)
4047
yield temp_dir
4148

4249

0 commit comments

Comments
 (0)