Skip to content

Commit

Permalink
test: replacing tmpdir with tmp_path in tests_pytorch/cli.py (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
fnhirwa committed Mar 16, 2024
1 parent 84c94ef commit 5325446
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/tests_pytorch/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -636,14 +636,14 @@ def test_cli_config_overwrite(cleandir):
LightningCLI(BoringModel, save_config_kwargs={"overwrite": True}, trainer_defaults=trainer_defaults)


def test_cli_config_filename(tmpdir):
def test_cli_config_filename(tmp_path):
with mock.patch("sys.argv", ["any.py", "fit"]):
LightningCLI(
BoringModel,
trainer_defaults={"default_root_dir": str(tmpdir), "logger": False, "max_steps": 1, "max_epochs": 1},
trainer_defaults={"default_root_dir": str(tmp_path), "logger": False, "max_steps": 1, "max_epochs": 1},
save_config_kwargs={"config_filename": "name.yaml"},
)
assert os.path.isfile(tmpdir / "name.yaml")
assert os.path.isfile(tmp_path / "name.yaml")


@pytest.mark.parametrize("run", [False, True])
Expand Down

0 comments on commit 5325446

Please sign in to comment.