File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -158,7 +158,7 @@ def check_for_abstract_op(tool: CWLObjectType) -> None:
158
158
)
159
159
160
160
if runtime_context .rm_tmpdir :
161
- if runtime_context .cachedir is None :
161
+ if not runtime_context .cachedir :
162
162
output_dirs = self .output_dirs # type: Iterable[str]
163
163
else :
164
164
output_dirs = filter (
Original file line number Diff line number Diff line change 14
14
from cwltool .context import LoadingContext , RuntimeContext
15
15
from cwltool .docker import DockerCommandLineJob
16
16
from cwltool .job import JobBase
17
+ from cwltool .main import main
17
18
from cwltool .pathmapper import MapperEnt , PathMapper
18
19
from cwltool .stdfsaccess import StdFsAccess
19
20
from cwltool .update import INTERNAL_VERSION , ORIGINAL_CWLVERSION
@@ -230,3 +231,20 @@ def test_runtimeContext_respects_tmp_outdir_prefix(tmp_path: Path) -> None:
230
231
runtime_context = RuntimeContext ({"tmp_outdir_prefix" : tmpdir_prefix })
231
232
assert runtime_context .get_outdir ().startswith (tmpdir_prefix )
232
233
assert runtime_context .create_outdir ().startswith (tmpdir_prefix )
234
+
235
+
236
+ def test_remove_tmpdirs (tmp_path : Path ) -> None :
237
+ """Test that the tmpdirs are removed after the job execution."""
238
+ assert (
239
+ main (
240
+ [
241
+ "--tmpdir-prefix" ,
242
+ str (f"{ tmp_path } /" ),
243
+ get_data ("tests/wf/hello_single_tool.cwl" ),
244
+ "--message" ,
245
+ "Hello" ,
246
+ ]
247
+ )
248
+ == 0
249
+ )
250
+ assert len (list (tmp_path .iterdir ())) == 0
You can’t perform that action at this time.
0 commit comments