зеркало из https://github.com/microsoft/torchgeo.git
Fix download mocks
This commit is contained in:
Родитель
360dd7a9b8
Коммит
02ca07bcef
|
@ -6,11 +6,11 @@ from typing import Generator
|
|||
import matplotlib.pyplot as plt
|
||||
import pytest
|
||||
import torch
|
||||
import torchvision.datasets.utils
|
||||
from _pytest.fixtures import SubRequest
|
||||
from pytest import MonkeyPatch
|
||||
from rasterio.crs import CRS
|
||||
|
||||
import torchgeo.datasets.utils
|
||||
from torchgeo.datasets import CDL, BoundingBox, ZipDataset
|
||||
from torchgeo.transforms import Identity
|
||||
|
||||
|
@ -28,7 +28,7 @@ class TestCDL:
|
|||
request: SubRequest,
|
||||
) -> CDL:
|
||||
monkeypatch.setattr( # type: ignore[attr-defined]
|
||||
torchvision.datasets.utils, "download_url", download_url
|
||||
torchgeo.datasets.utils, "download_url", download_url
|
||||
)
|
||||
md5s = [
|
||||
(2021, "0693f0bb10deb79c69bcafe4aa1635b7"),
|
||||
|
|
|
@ -5,11 +5,11 @@ from typing import Generator
|
|||
|
||||
import pytest
|
||||
import torch
|
||||
import torchvision.datasets.utils
|
||||
from _pytest.fixtures import SubRequest
|
||||
from pytest import MonkeyPatch
|
||||
from torch.utils.data import ConcatDataset
|
||||
|
||||
import torchgeo.datasets.utils
|
||||
from torchgeo.datasets import LandCoverAI
|
||||
from torchgeo.transforms import Identity
|
||||
|
||||
|
@ -27,7 +27,7 @@ class TestLandCoverAI:
|
|||
request: SubRequest,
|
||||
) -> LandCoverAI:
|
||||
monkeypatch.setattr( # type: ignore[attr-defined]
|
||||
torchvision.datasets.utils, "download_url", download_url
|
||||
torchgeo.datasets.utils, "download_url", download_url
|
||||
)
|
||||
md5 = "8a84857267619c8cf22730193b3b1ada"
|
||||
monkeypatch.setattr(LandCoverAI, "md5", md5) # type: ignore[attr-defined]
|
||||
|
|
Загрузка…
Ссылка в новой задаче