Skip to content

Commit

Permalink
Restore test after #11448
Browse files Browse the repository at this point in the history
  • Loading branch information
carmocca committed Feb 18, 2022
1 parent cf64f34 commit fc5211c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tests/trainer/flags/test_env_vars.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def test_passing_env_variables_defaults():
assert trainer.max_steps == 42


@mock.patch.dict(os.environ, {"CUDA_VISIBLE_DEVICES": "0,1", "PL_TRAINER_GPUS": "2"})
@mock.patch.dict(os.environ, {"CUDA_VISIBLE_DEVICES": "0,1", "PL_TRAINER_DEVICES": "2"})
@mock.patch("torch.cuda.device_count", return_value=2)
@mock.patch("torch.cuda.is_available", return_value=True)
def test_passing_env_variables_devices(cuda_available_mock, device_count_mock):
"""Testing overwriting trainer arguments."""
trainer = Trainer()
assert trainer.devices == 2
trainer = Trainer(accelerator="gpu", devices=1)
assert trainer.devices == 2
assert trainer.devices == 1

0 comments on commit fc5211c

Please sign in to comment.