Skip to content

Commit

Permalink
tests: correct skipif sense (#2931)
Browse files Browse the repository at this point in the history
Co-authored-by: Martin Mokry <[email protected]>
  • Loading branch information
martin-kokos and martin-kokos authored Feb 3, 2025
1 parent 3a9bb52 commit 6438cd5
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions tests/unittests/detection/test_map.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@ def _generate_coco_inputs(iou_type):
_coco_segm_input = _generate_coco_inputs("segm")


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


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


@pytest.mark.skipif(_PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 is installed")
@pytest.mark.skipif(
not _PYCOCOTOOLS_AVAILABLE, reason="test requires that torchvision=>0.8.0 and pycocotools is installed"
)
@pytest.mark.parametrize(
"backend",
[
Expand Down

0 comments on commit 6438cd5

Please sign in to comment.