You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
nnUNet Writes Into Current Directory By Default #8886
This was flagged by Coderabbit and should be addressed. nnUNet will write test data to the current directory during testing, this should be changed to writing to a temporary directory in tests. This avoids leaving a mess in the user's current directory.
⚠️ Potential issue | 🟠 Major | ⚡ Quick win
Keep the generated nnUNet paths inside self.test_dir.
nnUNetV2Runner.__init__ creates nnunet_raw, nnunet_preprocessed, and nnunet_results immediately. With the current ./... values, these tests write into the repo cwd instead of the temp directory, so state leaks across tests and tearDown() does not clean it up.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@tests/integration/test_integration_nnunetv2_runner.py` around lines 110 -
148, The test YAMLs currently use relative paths (./data, ./work, ./nnUNet_raw,
./nnUNet_preprocessed, ./nnUNet_results) so nnUNetV2Runner.__init__ creates
directories in the repo cwd; update the YAML strings (good_yml_content1,
good_yml_content2, injecting_yml_content) to build all generated paths inside
the test temp dir (use self.test_dir) for keys dataroot, datalist, work_dir,
nnunet_raw, nnunet_preprocessed, and nnunet_results so the runner creates those
folders under self.test_dir and tearDown can clean them up (also ensure the
injected dataset_name_or_id test keeps the path substitution to self.test_dir).
Activity
aymuos15 commentedon May 31, 2026
I’ll add a fix for this tomorrow if that’s okay.
Fix nnUNet test directory leakage into current working directory (#8887)