@@ -1291,6 +1291,8 @@ def test_cache_relative_paths(tmp_path: Path, factor: str) -> None:
12911291 commands = factor .split ()
12921292 commands .extend (
12931293 [
1294+ "--out" ,
1295+ str (tmp_path / "out" ),
12941296 "--cachedir" ,
12951297 cache_dir ,
12961298 get_data (f"tests/{ test_file } " ),
@@ -1306,6 +1308,8 @@ def test_cache_relative_paths(tmp_path: Path, factor: str) -> None:
13061308 commands = factor .split ()
13071309 commands .extend (
13081310 [
1311+ "--out" ,
1312+ str (tmp_path / "out2" ),
13091313 "--cachedir" ,
13101314 cache_dir ,
13111315 get_data (f"tests/{ test_file } " ),
@@ -1324,6 +1328,8 @@ def test_cache_relative_paths(tmp_path: Path, factor: str) -> None:
13241328def test_write_summary (tmp_path : Path ) -> None :
13251329 """Test --write-summary."""
13261330 commands = [
1331+ "--out" ,
1332+ str (tmp_path / "out1" ),
13271333 get_data ("tests/wf/no-parameters-echo.cwl" ),
13281334 ]
13291335 error_code , stdout , stderr = get_main_output (commands )
@@ -1332,6 +1338,8 @@ def test_write_summary(tmp_path: Path) -> None:
13321338
13331339 final_output_path = str (tmp_path / "final-output.json" )
13341340 commands_no = [
1341+ "--out" ,
1342+ str (tmp_path / "out2" ),
13351343 "--write-summary" ,
13361344 final_output_path ,
13371345 get_data ("tests/wf/no-parameters-echo.cwl" ),
@@ -1347,10 +1355,11 @@ def test_write_summary(tmp_path: Path) -> None:
13471355
13481356
13491357@needs_docker
1350- def test_compute_checksum () -> None :
1358+ def test_compute_checksum (tmp_path : Path ) -> None :
13511359 runtime_context = RuntimeContext ()
13521360 runtime_context .compute_checksum = True
13531361 runtime_context .use_container = False
1362+ runtime_context .outdir = str (tmp_path )
13541363 factory = cwltool .factory .Factory (runtime_context = runtime_context )
13551364 echo = factory .make (get_data ("tests/wf/cat-tool.cwl" ))
13561365 output = echo (
@@ -1413,10 +1422,12 @@ def test_bad_stdout_expr_error() -> None:
14131422
14141423
14151424@needs_docker
1416- def test_stdin_with_id_preset () -> None :
1425+ def test_stdin_with_id_preset (tmp_path : Path ) -> None :
14171426 """Confirm that a type: stdin with a preset id does not give an error."""
14181427 error_code , _ , stderr = get_main_output (
14191428 [
1429+ "--out" ,
1430+ str (tmp_path ),
14201431 get_data ("tests/wf/1590.cwl" ),
14211432 "--file1" ,
14221433 get_data ("tests/wf/whale.txt" ),
@@ -1590,7 +1601,7 @@ def test_v1_0_arg_empty_prefix_separate_false() -> None:
15901601
15911602def test_scatter_output_filenames (tmp_path : Path ) -> None :
15921603 """Confirm that the final output is renamed correctly from identically named scatter outputs."""
1593- cwd = Path . cwd ()
1604+ cwd = tmp_path
15941605 with working_directory (tmp_path ):
15951606 rtc = RuntimeContext ()
15961607 rtc .outdir = str (cwd )
@@ -1726,10 +1737,10 @@ def test_command_line_tool_class() -> None:
17261737 assert str (expression_tool ) == f"CommandLineTool: file://{ tool_path } "
17271738
17281739
1729- def test_record_default_with_long () -> None :
1740+ def test_record_default_with_long (tmp_path : Path ) -> None :
17301741 """Confirm that record defaults are respected."""
17311742 tool_path = get_data ("tests/wf/paramref_arguments_roundtrip.cwl" )
1732- err_code , stdout , stderr = get_main_output ([tool_path ])
1743+ err_code , stdout , stderr = get_main_output (["--outdir" , str ( tmp_path ), tool_path ])
17331744 assert err_code == 0
17341745 result = json .loads (stdout )["same_record" ]
17351746 assert result ["first" ] == "y"
0 commit comments