From af389759c3e6f0dac9838e5984416d9d52103d38 Mon Sep 17 00:00:00 2001 From: "Adam J. Stewart" Date: Sat, 19 Mar 2022 15:05:18 -0500 Subject: [PATCH] Entire Chesapeake13 test needs to be skipped for missing zipfile_deflate64 --- tests/datasets/test_chesapeake.py | 3 ++- tests/trainers/test_byol.py | 3 --- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/datasets/test_chesapeake.py b/tests/datasets/test_chesapeake.py index 3b5ecc389c2..6416f380383 100644 --- a/tests/datasets/test_chesapeake.py +++ b/tests/datasets/test_chesapeake.py @@ -28,9 +28,10 @@ def download_url(url: str, root: str, *args: str, **kwargs: str) -> None: class TestChesapeake13: + pytest.importorskip("zipfile_deflate64") + @pytest.fixture def dataset(self, monkeypatch: MonkeyPatch, tmp_path: Path) -> Chesapeake13: - pytest.importorskip("zipfile_deflate64") monkeypatch.setattr(torchgeo.datasets.chesapeake, "download_url", download_url) md5 = "fe35a615b8e749b21270472aa98bb42c" monkeypatch.setattr(Chesapeake13, "md5", md5) diff --git a/tests/trainers/test_byol.py b/tests/trainers/test_byol.py index b1c4dd68c4f..6380d65eea0 100644 --- a/tests/trainers/test_byol.py +++ b/tests/trainers/test_byol.py @@ -43,9 +43,6 @@ class TestBYOLTask: ], ) def test_trainer(self, name: str, classname: Type[LightningDataModule]) -> None: - if name == "chesapeake_cvpr_7": - pytest.importorskip("zipfile_deflate64") - conf = OmegaConf.load(os.path.join("conf", "task_defaults", name + ".yaml")) conf_dict = OmegaConf.to_object(conf.experiment) conf_dict = cast(Dict[Any, Dict[Any, Any]], conf_dict)