|
1 | 1 | from pathlib import Path
|
2 |
| -from typing import TYPE_CHECKING |
3 | 2 |
|
4 | 3 | import pytest
|
5 | 4 | import torch
|
6 | 5 | from syrupy import SnapshotAssertion
|
7 |
| - |
8 |
| -if TYPE_CHECKING: |
9 |
| - from torch.types import Device |
| 6 | +from torch.types import Device |
10 | 7 |
|
11 | 8 | from safeds.data.image.containers import Image
|
12 | 9 | from safeds.data.tabular.containers import Table
|
@@ -208,7 +205,7 @@ def test_should_be_equal(self, resource_path: str, device: Device) -> None:
|
208 | 205 | @pytest.mark.parametrize(
|
209 | 206 | "device", _test_devices(), ids=_test_devices_ids()
|
210 | 207 | )
|
211 |
| - def test_should_not_be_equal(self, device) -> None: |
| 208 | + def test_should_not_be_equal(self, device: Device) -> None: |
212 | 209 | _skip_if_device_not_available(device)
|
213 | 210 | image = Image.from_file(resolve_resource_path("image/plane.png"), device)
|
214 | 211 | image2 = Image.from_file(resolve_resource_path("image/white_square.png"), device)
|
@@ -297,7 +294,7 @@ def test_should_return_resized_image(
|
297 | 294 |
|
298 | 295 | class TestDevices:
|
299 | 296 |
|
300 |
| - def test_should_change_device(self): |
| 297 | + def test_should_change_device(self) -> None: |
301 | 298 | _skip_if_device_not_available(_device_cuda)
|
302 | 299 | image = Image.from_file(resolve_resource_path("image/plane.png"), torch.device("cpu"))
|
303 | 300 | new_device = torch.device("cuda", 0)
|
|
0 commit comments