Skip to content

Commit 63726aa

Browse files
committed
fix
1 parent 224fedf commit 63726aa

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

tests/test_merge.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,8 +270,6 @@ def test_merge_no_head(babs_project_sessionlevel, tmp_path, monkeypatch):
270270
"""Test babs_merge when there's no HEAD branch."""
271271
babs_proj = BABSMerge(babs_project_sessionlevel)
272272

273-
merge_ds_path = tmp_path / 'merge_ds'
274-
merge_ds_path.mkdir()
275273
monkeypatch.setattr(babs_proj, 'project_root', str(tmp_path))
276274

277275
def set_analysis_id():
@@ -282,7 +280,12 @@ def set_analysis_id():
282280

283281
from babs.merge import dlapi
284282

285-
monkeypatch.setattr(dlapi, 'clone', lambda source, path: None)
283+
def mock_clone(source, path):
284+
# Create the directory so subsequent git commands can run
285+
os.makedirs(path, exist_ok=True)
286+
return None
287+
288+
monkeypatch.setattr(dlapi, 'clone', mock_clone)
286289

287290
def mock_remote_show(cmd, **kwargs):
288291
if 'remote' in cmd and 'show' in cmd:
@@ -294,5 +297,5 @@ def mock_remote_show(cmd, **kwargs):
294297

295298
monkeypatch.setattr('babs.merge.subprocess.run', mock_remote_show)
296299

297-
with pytest.raises(Exception, match='There is no HEAD branch in output RIA'):
300+
with pytest.raises(Exception, match='There is no HEAD branch in output RIA!'):
298301
babs_proj.babs_merge()

0 commit comments

Comments
 (0)