diff --git a/environment.yml b/environment.yml index e99d50b75..1290e0dd2 100644 --- a/environment.yml +++ b/environment.yml @@ -36,7 +36,7 @@ dependencies: - pandas>=1.1.3 - pillow>=8 - pydocstyle[toml]>=6.1 - - pytest>=6.1.2 + - pytest>=6.2 - pytest-cov>=2.4 - git+https://github.com/pytorch/pytorch_sphinx_theme - pyupgrade>=2.8 diff --git a/requirements/min-reqs.old b/requirements/min-reqs.old index c1485fc34..d74ce8e41 100644 --- a/requirements/min-reqs.old +++ b/requirements/min-reqs.old @@ -50,7 +50,7 @@ hydra-core==1.0.0 mypy==0.900 nbmake==1.3.3 omegaconf==2.0.1 -pytest==6.1.2 +pytest==6.2.0 pytest-cov==2.4.0 tensorboard==2.9.1 diff --git a/setup.cfg b/setup.cfg index e5c5f9dc3..4e93bcd90 100644 --- a/setup.cfg +++ b/setup.cfg @@ -125,8 +125,8 @@ tests = nbmake>=1.3.3,<2 # omegaconf 2+ required by lightning, 2.0.1+ required by hydra-core omegaconf>=2.0.1,<3 - # pytest 6.1.2+ required by nbmake - pytest>=6.1.2,<8 + # pytest 6.2+ required for pytest.MonkeyPatch + pytest>=6.2,<8 # pytest-cov 2.4+ required for pytest --cov flags pytest-cov>=2.4,<5 # tensorboard 2.9.1+ required by lightning diff --git a/tests/datasets/test_advance.py b/tests/datasets/test_advance.py index c0a5b6208..abbffbf47 100644 --- a/tests/datasets/test_advance.py +++ b/tests/datasets/test_advance.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import ADVANCE diff --git a/tests/datasets/test_agb_live_woody_density.py b/tests/datasets/test_agb_live_woody_density.py index f2dff7a27..7800aecc1 100644 --- a/tests/datasets/test_agb_live_woody_density.py +++ b/tests/datasets/test_agb_live_woody_density.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo diff --git a/tests/datasets/test_benin_cashews.py b/tests/datasets/test_benin_cashews.py index 2ae85f47e..7255e491b 100644 --- a/tests/datasets/test_benin_cashews.py +++ b/tests/datasets/test_benin_cashews.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset from torchgeo.datasets import BeninSmallHolderCashews diff --git a/tests/datasets/test_bigearthnet.py b/tests/datasets/test_bigearthnet.py index b6b7324ad..7dfea2548 100644 --- a/tests/datasets/test_bigearthnet.py +++ b/tests/datasets/test_bigearthnet.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import BigEarthNet diff --git a/tests/datasets/test_cbf.py b/tests/datasets/test_cbf.py index 449d23141..eed082816 100644 --- a/tests/datasets/test_cbf.py +++ b/tests/datasets/test_cbf.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_cdl.py b/tests/datasets/test_cdl.py index b140c1f18..16a68b06f 100644 --- a/tests/datasets/test_cdl.py +++ b/tests/datasets/test_cdl.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_chesapeake.py b/tests/datasets/test_chesapeake.py index 1c49b313d..3348c1f6c 100644 --- a/tests/datasets/test_chesapeake.py +++ b/tests/datasets/test_chesapeake.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_cloud_cover.py b/tests/datasets/test_cloud_cover.py index c2b124253..15fb078d4 100644 --- a/tests/datasets/test_cloud_cover.py +++ b/tests/datasets/test_cloud_cover.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import CloudCoverDetection diff --git a/tests/datasets/test_cms_mangrove_canopy.py b/tests/datasets/test_cms_mangrove_canopy.py index de42cbf18..9a30a2a02 100644 --- a/tests/datasets/test_cms_mangrove_canopy.py +++ b/tests/datasets/test_cms_mangrove_canopy.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS from torchgeo.datasets import CMSGlobalMangroveCanopy, IntersectionDataset, UnionDataset diff --git a/tests/datasets/test_cowc.py b/tests/datasets/test_cowc.py index 271b88245..6742ecfb2 100644 --- a/tests/datasets/test_cowc.py +++ b/tests/datasets/test_cowc.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_cv4a_kenya_crop_type.py b/tests/datasets/test_cv4a_kenya_crop_type.py index 3271cfd81..638c63128 100644 --- a/tests/datasets/test_cv4a_kenya_crop_type.py +++ b/tests/datasets/test_cv4a_kenya_crop_type.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset from torchgeo.datasets import CV4AKenyaCropType diff --git a/tests/datasets/test_cyclone.py b/tests/datasets/test_cyclone.py index e573ce451..56788bab3 100644 --- a/tests/datasets/test_cyclone.py +++ b/tests/datasets/test_cyclone.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset from torchgeo.datasets import TropicalCyclone diff --git a/tests/datasets/test_deepglobelandcover.py b/tests/datasets/test_deepglobelandcover.py index e6f08bbf4..da243efc9 100644 --- a/tests/datasets/test_deepglobelandcover.py +++ b/tests/datasets/test_deepglobelandcover.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import DeepGlobeLandCover diff --git a/tests/datasets/test_dfc2022.py b/tests/datasets/test_dfc2022.py index dfda9480b..4b1a52215 100644 --- a/tests/datasets/test_dfc2022.py +++ b/tests/datasets/test_dfc2022.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import DFC2022 diff --git a/tests/datasets/test_eddmaps.py b/tests/datasets/test_eddmaps.py index d10ad8a29..59b6c8f57 100644 --- a/tests/datasets/test_eddmaps.py +++ b/tests/datasets/test_eddmaps.py @@ -7,7 +7,7 @@ from pathlib import Path from typing import Any import pytest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import BoundingBox, EDDMapS, IntersectionDataset, UnionDataset diff --git a/tests/datasets/test_enviroatlas.py b/tests/datasets/test_enviroatlas.py index 1a303f31b..53760f3a5 100644 --- a/tests/datasets/test_enviroatlas.py +++ b/tests/datasets/test_enviroatlas.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_esri2020.py b/tests/datasets/test_esri2020.py index 52cf5e3cf..74f9200cb 100644 --- a/tests/datasets/test_esri2020.py +++ b/tests/datasets/test_esri2020.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_etci2021.py b/tests/datasets/test_etci2021.py index 956784db7..c386005f1 100644 --- a/tests/datasets/test_etci2021.py +++ b/tests/datasets/test_etci2021.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import ETCI2021 diff --git a/tests/datasets/test_eudem.py b/tests/datasets/test_eudem.py index d3baf60cd..fd04f541e 100644 --- a/tests/datasets/test_eudem.py +++ b/tests/datasets/test_eudem.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS from torchgeo.datasets import EUDEM, BoundingBox, IntersectionDataset, UnionDataset diff --git a/tests/datasets/test_eurosat.py b/tests/datasets/test_eurosat.py index ccfe8057c..c79b1f80b 100644 --- a/tests/datasets/test_eurosat.py +++ b/tests/datasets/test_eurosat.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_fair1m.py b/tests/datasets/test_fair1m.py index 71e10d695..0983444ad 100644 --- a/tests/datasets/test_fair1m.py +++ b/tests/datasets/test_fair1m.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import FAIR1M diff --git a/tests/datasets/test_fire_risk.py b/tests/datasets/test_fire_risk.py index ca70cda67..8e42cfe97 100644 --- a/tests/datasets/test_fire_risk.py +++ b/tests/datasets/test_fire_risk.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import FireRisk diff --git a/tests/datasets/test_forestdamage.py b/tests/datasets/test_forestdamage.py index 419bedb96..8e333879f 100644 --- a/tests/datasets/test_forestdamage.py +++ b/tests/datasets/test_forestdamage.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import ForestDamage diff --git a/tests/datasets/test_gbif.py b/tests/datasets/test_gbif.py index df32844a8..fd3a383fd 100644 --- a/tests/datasets/test_gbif.py +++ b/tests/datasets/test_gbif.py @@ -7,7 +7,7 @@ from pathlib import Path from typing import Any import pytest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import GBIF, BoundingBox, IntersectionDataset, UnionDataset diff --git a/tests/datasets/test_gid15.py b/tests/datasets/test_gid15.py index c74fd61ba..26d269c13 100644 --- a/tests/datasets/test_gid15.py +++ b/tests/datasets/test_gid15.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import GID15 diff --git a/tests/datasets/test_globbiomass.py b/tests/datasets/test_globbiomass.py index 046fcb773..2bc94bdc0 100644 --- a/tests/datasets/test_globbiomass.py +++ b/tests/datasets/test_globbiomass.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS from torchgeo.datasets import ( diff --git a/tests/datasets/test_idtrees.py b/tests/datasets/test_idtrees.py index 5247157d6..addc383bc 100644 --- a/tests/datasets/test_idtrees.py +++ b/tests/datasets/test_idtrees.py @@ -13,7 +13,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import IDTReeS diff --git a/tests/datasets/test_inaturalist.py b/tests/datasets/test_inaturalist.py index 32891ec32..5bac9c4a5 100644 --- a/tests/datasets/test_inaturalist.py +++ b/tests/datasets/test_inaturalist.py @@ -7,7 +7,7 @@ from pathlib import Path from typing import Any import pytest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import ( BoundingBox, diff --git a/tests/datasets/test_inria.py b/tests/datasets/test_inria.py index 4167f7859..1ccbd22af 100644 --- a/tests/datasets/test_inria.py +++ b/tests/datasets/test_inria.py @@ -9,7 +9,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import InriaAerialImageLabeling diff --git a/tests/datasets/test_l7irish.py b/tests/datasets/test_l7irish.py index b89f4819b..eb7e8ccbe 100644 --- a/tests/datasets/test_l7irish.py +++ b/tests/datasets/test_l7irish.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_l8biome.py b/tests/datasets/test_l8biome.py index 950cce4ae..efae715d9 100644 --- a/tests/datasets/test_l8biome.py +++ b/tests/datasets/test_l8biome.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_landcoverai.py b/tests/datasets/test_landcoverai.py index a604533e3..aba9da864 100644 --- a/tests/datasets/test_landcoverai.py +++ b/tests/datasets/test_landcoverai.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_landsat.py b/tests/datasets/test_landsat.py index e82151a05..f4ce259f6 100644 --- a/tests/datasets/test_landsat.py +++ b/tests/datasets/test_landsat.py @@ -9,7 +9,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS from torchgeo.datasets import BoundingBox, IntersectionDataset, Landsat8, UnionDataset diff --git a/tests/datasets/test_levircd.py b/tests/datasets/test_levircd.py index cfda8e251..b4a46d43e 100644 --- a/tests/datasets/test_levircd.py +++ b/tests/datasets/test_levircd.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import LEVIRCDPlus diff --git a/tests/datasets/test_loveda.py b/tests/datasets/test_loveda.py index b212a439c..666afce52 100644 --- a/tests/datasets/test_loveda.py +++ b/tests/datasets/test_loveda.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import LoveDA diff --git a/tests/datasets/test_nasa_marine_debris.py b/tests/datasets/test_nasa_marine_debris.py index cf197d196..05c96c8dc 100644 --- a/tests/datasets/test_nasa_marine_debris.py +++ b/tests/datasets/test_nasa_marine_debris.py @@ -10,7 +10,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import NASAMarineDebris diff --git a/tests/datasets/test_nlcd.py b/tests/datasets/test_nlcd.py index e891eeca9..f68d01f78 100644 --- a/tests/datasets/test_nlcd.py +++ b/tests/datasets/test_nlcd.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_openbuildings.py b/tests/datasets/test_openbuildings.py index 04b87eced..d8df3d8dc 100644 --- a/tests/datasets/test_openbuildings.py +++ b/tests/datasets/test_openbuildings.py @@ -13,7 +13,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS from torchgeo.datasets import ( diff --git a/tests/datasets/test_oscd.py b/tests/datasets/test_oscd.py index 365bcd97a..78cbd30b8 100644 --- a/tests/datasets/test_oscd.py +++ b/tests/datasets/test_oscd.py @@ -10,8 +10,8 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from matplotlib import pyplot as plt +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_patternnet.py b/tests/datasets/test_patternnet.py index 5214fa7c7..7e06264bf 100644 --- a/tests/datasets/test_patternnet.py +++ b/tests/datasets/test_patternnet.py @@ -9,7 +9,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import PatternNet diff --git a/tests/datasets/test_potsdam.py b/tests/datasets/test_potsdam.py index 2812c47f4..7502a3db6 100644 --- a/tests/datasets/test_potsdam.py +++ b/tests/datasets/test_potsdam.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import Potsdam2D diff --git a/tests/datasets/test_reforestree.py b/tests/datasets/test_reforestree.py index aa6bb3a02..212a7d645 100644 --- a/tests/datasets/test_reforestree.py +++ b/tests/datasets/test_reforestree.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import ReforesTree diff --git a/tests/datasets/test_resisc45.py b/tests/datasets/test_resisc45.py index fc4191512..b20a19ddb 100644 --- a/tests/datasets/test_resisc45.py +++ b/tests/datasets/test_resisc45.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import RESISC45 diff --git a/tests/datasets/test_seco.py b/tests/datasets/test_seco.py index a01863d0e..743a90c2b 100644 --- a/tests/datasets/test_seco.py +++ b/tests/datasets/test_seco.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_sen12ms.py b/tests/datasets/test_sen12ms.py index 864d56764..55ecb406b 100644 --- a/tests/datasets/test_sen12ms.py +++ b/tests/datasets/test_sen12ms.py @@ -9,7 +9,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset from torchgeo.datasets import SEN12MS diff --git a/tests/datasets/test_skippd.py b/tests/datasets/test_skippd.py index 7af3d1f51..a35d6fb9e 100644 --- a/tests/datasets/test_skippd.py +++ b/tests/datasets/test_skippd.py @@ -12,7 +12,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import SKIPPD diff --git a/tests/datasets/test_so2sat.py b/tests/datasets/test_so2sat.py index df6c4c538..5802d81b5 100644 --- a/tests/datasets/test_so2sat.py +++ b/tests/datasets/test_so2sat.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import So2Sat diff --git a/tests/datasets/test_spacenet.py b/tests/datasets/test_spacenet.py index e3ef34b08..4b79ca3fa 100644 --- a/tests/datasets/test_spacenet.py +++ b/tests/datasets/test_spacenet.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import ( SpaceNet1, diff --git a/tests/datasets/test_ssl4eo.py b/tests/datasets/test_ssl4eo.py index b743daad2..0d00175d0 100644 --- a/tests/datasets/test_ssl4eo.py +++ b/tests/datasets/test_ssl4eo.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset from torchgeo.datasets import SSL4EOS12 diff --git a/tests/datasets/test_sustainbench_crop_yield.py b/tests/datasets/test_sustainbench_crop_yield.py index 90c2a58b6..04c056ed5 100644 --- a/tests/datasets/test_sustainbench_crop_yield.py +++ b/tests/datasets/test_sustainbench_crop_yield.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import SustainBenchCropYield diff --git a/tests/datasets/test_ucmerced.py b/tests/datasets/test_ucmerced.py index e2a6db6b7..c40962767 100644 --- a/tests/datasets/test_ucmerced.py +++ b/tests/datasets/test_ucmerced.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_usavars.py b/tests/datasets/test_usavars.py index 8e437279a..45ff2dc72 100644 --- a/tests/datasets/test_usavars.py +++ b/tests/datasets/test_usavars.py @@ -11,8 +11,8 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from matplotlib import pyplot as plt +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_utils.py b/tests/datasets/test_utils.py index b2dd9cc53..0346d13a2 100644 --- a/tests/datasets/test_utils.py +++ b/tests/datasets/test_utils.py @@ -16,7 +16,7 @@ from typing import Any import numpy as np import pytest import torch -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from rasterio.crs import CRS import torchgeo.datasets.utils diff --git a/tests/datasets/test_vaihingen.py b/tests/datasets/test_vaihingen.py index 3237c68d9..56240b2ac 100644 --- a/tests/datasets/test_vaihingen.py +++ b/tests/datasets/test_vaihingen.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import Vaihingen2D diff --git a/tests/datasets/test_vhr10.py b/tests/datasets/test_vhr10.py index 46ff434ad..ce69db7ef 100644 --- a/tests/datasets/test_vhr10.py +++ b/tests/datasets/test_vhr10.py @@ -12,7 +12,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torch.utils.data import ConcatDataset import torchgeo.datasets.utils diff --git a/tests/datasets/test_western_usa_live_fuel_moisture.py b/tests/datasets/test_western_usa_live_fuel_moisture.py index c3246d2f0..0015081f3 100644 --- a/tests/datasets/test_western_usa_live_fuel_moisture.py +++ b/tests/datasets/test_western_usa_live_fuel_moisture.py @@ -11,7 +11,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import WesternUSALiveFuelMoisture diff --git a/tests/datasets/test_xview2.py b/tests/datasets/test_xview2.py index d5b2ea004..957de5a36 100644 --- a/tests/datasets/test_xview2.py +++ b/tests/datasets/test_xview2.py @@ -10,7 +10,7 @@ import pytest import torch import torch.nn as nn from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchgeo.datasets import XView2 diff --git a/tests/datasets/test_zuericrop.py b/tests/datasets/test_zuericrop.py index 49beeb3b9..18b5a87eb 100644 --- a/tests/datasets/test_zuericrop.py +++ b/tests/datasets/test_zuericrop.py @@ -11,7 +11,7 @@ import matplotlib.pyplot as plt import pytest import torch import torch.nn as nn -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch import torchgeo.datasets.utils from torchgeo.datasets import ZueriCrop diff --git a/tests/models/test_resnet.py b/tests/models/test_resnet.py index c37de00db..f6b6eba02 100644 --- a/tests/models/test_resnet.py +++ b/tests/models/test_resnet.py @@ -9,7 +9,7 @@ import timm import torch import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchvision.models._api import WeightsEnum from torchgeo.models import ResNet18_Weights, ResNet50_Weights, resnet18, resnet50 diff --git a/tests/models/test_vit.py b/tests/models/test_vit.py index 5bee25ff1..37baf9d9c 100644 --- a/tests/models/test_vit.py +++ b/tests/models/test_vit.py @@ -9,7 +9,7 @@ import timm import torch import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch +from pytest import MonkeyPatch from torchvision.models._api import WeightsEnum from torchgeo.models import ViTSmall16_Weights, vit_small_patch16_224 diff --git a/tests/trainers/test_byol.py b/tests/trainers/test_byol.py index 4b0e9957c..2c68fc29f 100644 --- a/tests/trainers/test_byol.py +++ b/tests/trainers/test_byol.py @@ -11,10 +11,10 @@ import torch import torch.nn as nn import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torchvision.models import resnet18 from torchvision.models._api import WeightsEnum diff --git a/tests/trainers/test_classification.py b/tests/trainers/test_classification.py index 91c1ee9e5..817f53fb0 100644 --- a/tests/trainers/test_classification.py +++ b/tests/trainers/test_classification.py @@ -11,10 +11,10 @@ import torch import torch.nn as nn import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn.modules import Module from torchvision.models._api import WeightsEnum diff --git a/tests/trainers/test_detection.py b/tests/trainers/test_detection.py index 9fde52f91..77ac3a3d7 100644 --- a/tests/trainers/test_detection.py +++ b/tests/trainers/test_detection.py @@ -8,10 +8,10 @@ import pytest import torch import torch.nn as nn import torchvision.models.detection -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn.modules import Module from torchgeo.datamodules import MisconfigurationException, NASAMarineDebrisDataModule diff --git a/tests/trainers/test_moco.py b/tests/trainers/test_moco.py index 33ed07f31..23baf250d 100644 --- a/tests/trainers/test_moco.py +++ b/tests/trainers/test_moco.py @@ -10,10 +10,10 @@ import timm import torch import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn import Module from torchvision.models._api import WeightsEnum diff --git a/tests/trainers/test_regression.py b/tests/trainers/test_regression.py index cb12c674b..ab3e8dff1 100644 --- a/tests/trainers/test_regression.py +++ b/tests/trainers/test_regression.py @@ -12,10 +12,10 @@ import torch import torch.nn as nn import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn.modules import Module from torchvision.models._api import WeightsEnum diff --git a/tests/trainers/test_segmentation.py b/tests/trainers/test_segmentation.py index 7fd7badcd..bc7f5e5b3 100644 --- a/tests/trainers/test_segmentation.py +++ b/tests/trainers/test_segmentation.py @@ -12,10 +12,10 @@ import torch import torch.nn as nn import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn.modules import Module from torchvision.models._api import WeightsEnum diff --git a/tests/trainers/test_simclr.py b/tests/trainers/test_simclr.py index e7af9e8dd..d8e053d87 100644 --- a/tests/trainers/test_simclr.py +++ b/tests/trainers/test_simclr.py @@ -10,10 +10,10 @@ import timm import torch import torchvision from _pytest.fixtures import SubRequest -from _pytest.monkeypatch import MonkeyPatch from hydra.utils import instantiate from lightning.pytorch import Trainer from omegaconf import OmegaConf +from pytest import MonkeyPatch from torch.nn import Module from torchvision.models._api import WeightsEnum