From 898bd64b22a552c2005a14cf2518a50fb5eef051 Mon Sep 17 00:00:00 2001 From: pauladkisson Date: Tue, 1 Oct 2024 12:10:08 -0700 Subject: [PATCH] updated tests to use new testing tools --- tests/mixins/imaging_extractor_mixin.py | 6 ------ tests/test_minimal/test_tools/test_testing.py | 9 ++++++--- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/tests/mixins/imaging_extractor_mixin.py b/tests/mixins/imaging_extractor_mixin.py index aa2c2c59..b7901c65 100644 --- a/tests/mixins/imaging_extractor_mixin.py +++ b/tests/mixins/imaging_extractor_mixin.py @@ -65,9 +65,6 @@ def test_get_frames_invalid_frame_idxs(self, imaging_extractor): with pytest.raises(AssertionError): imaging_extractor.get_frames(frame_idxs=[0.5]) - def test_eq(self, imaging_extractor, imaging_extractor2): - assert imaging_extractor == imaging_extractor2 - @pytest.mark.parametrize("start_frame, end_frame", [(None, None), (1, 3), (0, 1)]) def test_frame_slice(self, imaging_extractor, start_frame, end_frame): frame_slice_imaging_extractor = imaging_extractor.frame_slice(start_frame=start_frame, end_frame=end_frame) @@ -218,9 +215,6 @@ def test_copy_times_frame_slice(self, frame_slice_imaging_extractor, frame_slice assert np.array_equal(frame_slice_imaging_extractor2._times, expected_times) assert frame_slice_imaging_extractor2._times is not expected_times - def test_eq_frame_slice(self, frame_slice_imaging_extractor, frame_slice_imaging_extractor2): - assert frame_slice_imaging_extractor == frame_slice_imaging_extractor2 - @pytest.mark.parametrize("start_frame, end_frame", [(None, None), (1, 2), (0, 1)]) def test_frame_slice_on_frame_slice(self, frame_slice_imaging_extractor, start_frame, end_frame): twice_sliced_imaging_extractor = frame_slice_imaging_extractor.frame_slice( diff --git a/tests/test_minimal/test_tools/test_testing.py b/tests/test_minimal/test_tools/test_testing.py index 325dc5ca..df041f08 100644 --- a/tests/test_minimal/test_tools/test_testing.py +++ b/tests/test_minimal/test_tools/test_testing.py @@ -2,7 +2,10 @@ generate_mock_video, generate_mock_imaging_extractor, generate_mock_segmentation_extractor, + assert_imaging_equal, + imaging_equal, assert_segmentation_equal, + segmentation_equal, ) import pytest import numpy as np @@ -55,8 +58,8 @@ def test_generate_mock_imaging_extractor_seed(): imaging_extractor1 = generate_mock_imaging_extractor(seed=0) imaging_extractor2 = generate_mock_imaging_extractor(seed=0) imaging_extractor3 = generate_mock_imaging_extractor(seed=1) - assert imaging_extractor1 == imaging_extractor2 - assert imaging_extractor1 != imaging_extractor3 + assert_imaging_equal(imaging_extractor1, imaging_extractor2) + assert not imaging_equal(imaging_extractor1, imaging_extractor3) @pytest.mark.parametrize( @@ -115,4 +118,4 @@ def test_generate_mock_segmentation_extractor_seed(): segmentation_extractor2 = generate_mock_segmentation_extractor(seed=0) segmentation_extractor3 = generate_mock_segmentation_extractor(seed=1) assert_segmentation_equal(segmentation_extractor1, segmentation_extractor2) - # assert_segmentation_equal(segmentation_extractor1, segmentation_extractor3) + assert not segmentation_equal(segmentation_extractor1, segmentation_extractor3)