Skip to content

Commit c1f3044

Browse files
Replace tmpdir with tmp_path in test
1 parent d3903d1 commit c1f3044

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tests/tests_pytorch/strategies/launchers/test_subprocess_script.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import subprocess
22
import sys
3-
from pathlib import Path
43
from unittest.mock import Mock
54

65
import pytest
@@ -51,16 +50,16 @@ def task_fn(cfg):
5150
@RunIf(min_cuda_gpus=2, skip_windows=True, standalone=True)
5251
@pytest.mark.skipif(not _HYDRA_WITH_RUN_PROCESS, reason=str(_HYDRA_WITH_RUN_PROCESS))
5352
@pytest.mark.parametrize("subdir", [None, "null", "dksa", ".hello"])
54-
def test_ddp_with_hydra_runjob(subdir, tmpdir, monkeypatch):
55-
monkeypatch.chdir(tmpdir)
53+
def test_ddp_with_hydra_runjob(subdir, tmp_path, monkeypatch):
54+
monkeypatch.chdir(tmp_path)
5655

5756
# Save script locally
5857
with open("temp.py", "w") as fn:
5958
fn.write(script)
6059

6160
# Run CLI
6261
devices = 2
63-
run_dir = Path(tmpdir) / "hydra_output"
62+
run_dir = tmp_path / "hydra_output"
6463
cmd = [sys.executable, "temp.py", f"+devices={devices}", '+strategy="ddp"', f"hydra.run.dir={run_dir}"]
6564
if subdir is not None:
6665
cmd += [f"hydra.output_subdir={subdir}"]

0 commit comments

Comments
 (0)