Skip to content

Commit

Permalink
Fix test_device.py
Browse files Browse the repository at this point in the history
  • Loading branch information
frostedoyster committed May 19, 2024
1 parent 9184b1a commit 4f1a3f6
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions tests/utils/test_device.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,6 @@ def _get_available_devices() -> List[str]:
assert picked_devices == [torch.device("mps")]


@pytest.mark.parametrize("desired_device", ["multi-cuda", None])
def test_pick_devices__multi_cuda(desired_device, monkeypatch):
def _get_available_devices() -> List[str]:
return ["cuda:0", "cuda:1", "cpu"]

monkeypatch.setattr(devices, "_get_available_devices", _get_available_devices)

picked_devices = pick_devices(["cuda", "cpu"], desired_device)

assert picked_devices == [torch.device("cuda:0"), torch.device("cuda:1")]


def test_pick_devices_unsoprted():
match = "Unsupported desired device 'cuda'. Please choose from cpu."
with pytest.raises(ValueError, match=match):
Expand Down

0 comments on commit 4f1a3f6

Please sign in to comment.