Skip to content

Commit f472677

Browse files
committed
fix
1 parent 94761f5 commit f472677

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

babs/merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def robust_rm_dir(path, max_retries=3, retry_delay=1):
3939
# For datalad datasets, try datalad remove first
4040
if is_datalad_dataset:
4141
try:
42-
dlapi.remove(path=path, reckless='availability')
42+
dlapi.remove(path=path, dataset=path, reckless='availability')
4343
# datalad remove might not remove everything, check if path still exists
4444
if not op.exists(path):
4545
return

tests/test_merge.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,10 +107,10 @@ def test_rm_dir_datalad_ok(tmp_path, monkeypatch):
107107
(test_dir / 'file.txt').write_text('test')
108108

109109
# Mock datalad.remove to succeed
110-
def mock_remove(path, **kwargs):
110+
def mock_remove(path=None, dataset=None, **kwargs):
111111
import shutil
112112

113-
shutil.rmtree(path)
113+
shutil.rmtree(dataset or path)
114114

115115
monkeypatch.setattr(dlapi, 'remove', mock_remove)
116116

@@ -127,7 +127,7 @@ def test_rm_dir_datalad_fail(tmp_path, monkeypatch):
127127
(test_dir / 'file.txt').write_text('test')
128128

129129
# Mock datalad.remove to raise an exception
130-
def mock_remove(path, **kwargs):
130+
def mock_remove(path=None, dataset=None, **kwargs):
131131
raise Exception('datalad remove failed')
132132

133133
monkeypatch.setattr(dlapi, 'remove', mock_remove)
@@ -145,7 +145,7 @@ def test_rm_dir_datalad_partial(tmp_path, monkeypatch):
145145
(test_dir / 'file.txt').write_text('test')
146146

147147
# Mock datalad.remove to succeed but not remove everything
148-
def mock_remove(path, **kwargs):
148+
def mock_remove(path=None, dataset=None, **kwargs):
149149
# Remove some files but leave the directory
150150
(test_dir / 'file.txt').unlink()
151151
# Don't actually remove the directory

0 commit comments

Comments
 (0)