File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -226,6 +226,7 @@ jobs:
226
226
no_output_timeout : 2h
227
227
command : |
228
228
docker run -ti --rm=false \
229
+ -e TEST_READONLY_FILESYSTEM=1 -v $HOME:/home/fmriprep:ro \
229
230
--entrypoint="pytest" poldracklab/fmriprep:latest \
230
231
/src/fmriprep/fmriprep -svx --doctest-modules
231
232
Original file line number Diff line number Diff line change 1
1
"""Test version checks."""
2
+ from os import getenv
2
3
from datetime import datetime
3
4
from pathlib import Path
4
5
from packaging .version import Version
@@ -165,9 +166,12 @@ def mock_get(*args, **kwargs):
165
166
166
167
def test_readonly (tmp_path , monkeypatch ):
167
168
"""Test behavior when $HOME/.cache/fmriprep/latest can't be written out."""
168
- monkeypatch .setenv ('HOME' , str (tmp_path ))
169
- cachedir = tmp_path / '.cache'
170
- cachedir .mkdir (mode = 0o555 , exist_ok = True )
169
+ if getenv ('TEST_READONLY_FILESYSTEM' ):
170
+ cachedir = Path (getenv ('HOME' )) / '.cache'
171
+ else :
172
+ monkeypatch .setenv ('HOME' , str (tmp_path ))
173
+ cachedir = tmp_path / '.cache'
174
+ cachedir .mkdir (mode = 0o555 , exist_ok = True )
171
175
172
176
# Make sure creating the folder will raise the exception.
173
177
with pytest .raises (OSError ):
You can’t perform that action at this time.
0 commit comments