Skip to content

Commit

Permalink
✅ Unlink symlink instead of rmtree
Browse files Browse the repository at this point in the history
  • Loading branch information
shnizzedy committed Jul 18, 2024
1 parent dd0985f commit 7b04cc8
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions dev/circleci_data/test_external_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
from logging import INFO
import os
from pathlib import Path
from shutil import rmtree
import sys

import click
Expand Down Expand Up @@ -111,7 +110,12 @@ def test_new_settings_template(bids_examples, caplog, cli_runner):
participant_yaml = DATA_DIR / "data_config_ds051.yml"
group_yaml = DATA_DIR / "group_analysis_participants_ds051.txt"

rmtree(str(example_dir))
if example_dir.is_symlink() or example_dir.is_file():
example_dir.unlink()
else:
from shutil import rmtree

rmtree(example_dir)
assert result.exit_code == 0
assert "\n".join(caplog.messages).startswith(
"\nGenerating data configuration file.."
Expand Down

0 comments on commit 7b04cc8

Please sign in to comment.