Skip to content

Commit 8362713

Browse files
committed
Update test_accelerator_connector.py
1 parent ca698e5 commit 8362713

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

tests/accelerators/test_accelerator_connector.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ def test_accelerator_choice_ddp_spawn(cuda_available_mock, device_count_mock):
9898
@mock.patch("torch.cuda.set_device")
9999
@mock.patch("torch.cuda.device_count", return_value=2)
100100
@mock.patch("pytorch_lightning.strategies.DDPStrategy.setup_distributed", autospec=True)
101-
@mock.path("torch.cuda.is_available", return_value=True)
101+
@mock.patch("torch.cuda.is_available", return_value=True)
102102
def test_accelerator_choice_ddp_slurm(*_):
103103
with pytest.deprecated_call(match=r"accelerator='ddp'\)` has been deprecated in v1.5"):
104104
trainer = Trainer(fast_dev_run=True, accelerator="ddp", gpus=2)
@@ -124,7 +124,7 @@ def test_accelerator_choice_ddp_slurm(*_):
124124
@mock.patch("torch.cuda.set_device")
125125
@mock.patch("torch.cuda.device_count", return_value=2)
126126
@mock.patch("pytorch_lightning.strategies.DDPStrategy.setup_distributed", autospec=True)
127-
@mock.path("torch.cuda.is_available", return_value=True)
127+
@mock.patch("torch.cuda.is_available", return_value=True)
128128
def test_accelerator_choice_ddp2_slurm(*_):
129129
with pytest.deprecated_call(match=r"accelerator='ddp2'\)` has been deprecated in v1.5"):
130130
trainer = Trainer(fast_dev_run=True, accelerator="ddp2", gpus=2)
@@ -150,7 +150,7 @@ def test_accelerator_choice_ddp2_slurm(*_):
150150
@mock.patch("torch.cuda.set_device")
151151
@mock.patch("torch.cuda.device_count", return_value=1)
152152
@mock.patch("pytorch_lightning.strategies.DDPStrategy.setup_distributed", autospec=True)
153-
@mock.path("torch.cuda.is_available", return_value=True)
153+
@mock.patch("torch.cuda.is_available", return_value=True)
154154
def test_accelerator_choice_ddp_te(*_):
155155
with pytest.deprecated_call(match=r"accelerator='ddp'\)` has been deprecated in v1.5"):
156156
trainer = Trainer(fast_dev_run=True, accelerator="ddp", gpus=2)
@@ -175,7 +175,7 @@ def test_accelerator_choice_ddp_te(*_):
175175
@mock.patch("torch.cuda.set_device")
176176
@mock.patch("torch.cuda.device_count", return_value=1)
177177
@mock.patch("pytorch_lightning.strategies.DDPStrategy.setup_distributed", autospec=True)
178-
@mock.path("torch.cuda.is_available", return_value=True)
178+
@mock.patch("torch.cuda.is_available", return_value=True)
179179
def test_accelerator_choice_ddp2_te(*_):
180180
with pytest.deprecated_call(match=r"accelerator='ddp2'\)` has been deprecated in v1.5"):
181181
trainer = Trainer(fast_dev_run=True, accelerator="ddp2", gpus=2)
@@ -214,7 +214,7 @@ def test_accelerator_choice_ddp_cpu_te(*_):
214214
@mock.patch("torch.cuda.set_device")
215215
@mock.patch("torch.cuda.device_count", return_value=1)
216216
@mock.patch("pytorch_lightning.strategies.DDPStrategy.setup_distributed", autospec=True)
217-
@mock.path("torch.cuda.is_available", return_value=True)
217+
@mock.patch("torch.cuda.is_available", return_value=True)
218218
def test_accelerator_choice_ddp_kubeflow(*_):
219219
with pytest.deprecated_call(match=r"accelerator='ddp'\)` has been deprecated in v1.5"):
220220
trainer = Trainer(fast_dev_run=True, accelerator="ddp", gpus=1)

0 commit comments

Comments
 (0)