Skip to content

Commit b8b86a3

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent 86abd61 commit b8b86a3

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

tests/accelerators/test_accelerator_connector.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,8 @@
4141
SLURMEnvironment,
4242
TorchElasticEnvironment,
4343
)
44-
from pytorch_lightning.utilities.exceptions import MisconfigurationException
4544
from pytorch_lightning.utilities import _GPU_AVAILABLE
45+
from pytorch_lightning.utilities.exceptions import MisconfigurationException
4646
from tests.helpers.boring_model import BoringModel
4747
from tests.helpers.runif import RunIf
4848

@@ -562,7 +562,7 @@ def test_accelerator_cpu():
562562

563563
with pytest.raises(MisconfigurationException, match="You passed `accelerator='gpu'`, but GPUs are not available"):
564564
trainer = Trainer(accelerator="gpu")
565-
565+
566566
# with pytest.raises(MisconfigurationException, match="You passed `accelerator='gpu'`, but GPUs are not available"):
567567
# trainer = Trainer(accelerator="cpu", gpus=1)
568568

@@ -575,7 +575,9 @@ def test_accelerator_gpu():
575575
assert trainer._device_type == "gpu"
576576
assert isinstance(trainer.accelerator, GPUAccelerator)
577577

578-
with pytest.raises(MisconfigurationException, match="You passed `accelerator='gpu'`, but you didn't pass `gpus` to `Trainer`"):
578+
with pytest.raises(
579+
MisconfigurationException, match="You passed `accelerator='gpu'`, but you didn't pass `gpus` to `Trainer`"
580+
):
579581
trainer = Trainer(accelerator="gpu")
580582

581583
trainer = Trainer(accelerator="auto", gpus=1)
@@ -585,8 +587,8 @@ def test_accelerator_gpu():
585587

586588

587589
def test_accelerator_cpu_with_gpus_flag():
588-
590+
589591
trainer = Trainer(accelerator="cpu", gpus=1)
590592

591593
assert trainer._device_type == "cpu"
592-
assert isinstance(trainer.accelerator, GPUAccelerator)
594+
assert isinstance(trainer.accelerator, GPUAccelerator)

0 commit comments

Comments
 (0)