Skip to content

Commit

Permalink
updated tests to use new testing tools
Browse files Browse the repository at this point in the history
  • Loading branch information
pauladkisson committed Oct 1, 2024
1 parent d2540fd commit 898bd64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 0 additions & 6 deletions tests/mixins/imaging_extractor_mixin.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down
9 changes: 6 additions & 3 deletions tests/test_minimal/test_tools/test_testing.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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)

0 comments on commit 898bd64

Please sign in to comment.