Skip to content

Commit 6438cd5

Browse files
authored
tests: correct skipif sense (#2931)
Co-authored-by: Martin Mokry <martin-kokos@users.noreply.github.com>
1 parent 3a9bb52 commit 6438cd5

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

tests/unittests/detection/test_map.py

+9-3
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,9 @@ def _generate_coco_inputs(iou_type):
6262
_coco_segm_input = _generate_coco_inputs("segm")
6363

6464

65-
@pytest.mark.skipif(_PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed")
65+
@pytest.mark.skipif(
66+
not _PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed"
67+
)
6668
@pytest.mark.parametrize("iou_type", ["bbox", "segm"])
6769
@pytest.mark.parametrize("backend", ["pycocotools", "faster_coco_eval"])
6870
def test_tm_to_coco(tmpdir, iou_type, backend):
@@ -172,7 +174,9 @@ def _compare_against_coco_fn(preds, target, iou_type, iou_thresholds=None, rec_t
172174
}
173175

174176

175-
@pytest.mark.skipif(_PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed")
177+
@pytest.mark.skipif(
178+
not _PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed"
179+
)
176180
@pytest.mark.parametrize("iou_type", ["bbox", "segm"])
177181
@pytest.mark.parametrize("ddp", [pytest.param(True, marks=pytest.mark.DDP), False])
178182
@pytest.mark.parametrize("backend", ["pycocotools", "faster_coco_eval"])
@@ -447,7 +451,9 @@ def _generate_random_segm_input(device, batch_size=2, num_preds_size=10, num_gt_
447451
return preds, targets
448452

449453

450-
@pytest.mark.skipif(_PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 is installed")
454+
@pytest.mark.skipif(
455+
not _PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed"
456+
)
451457
@pytest.mark.parametrize(
452458
"backend",
453459
[

0 commit comments

Comments
 (0)