MonkeyPatch exposed in public API in newer pytest (#1333)

* MonkeyPatch exposed in public API in newer pytest

* Fix import order
This commit is contained in:
Adam J. Stewart 2023-05-14 11:00:19 -05:00 коммит произвёл GitHub
Родитель 4b9a6d7178
Коммит dddd723d8d
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
70 изменённых файлов: 71 добавлений и 71 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 (

Просмотреть файл

@ -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

Просмотреть файл

@ -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,

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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 (

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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,

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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

Просмотреть файл

@ -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