From 360532689dfa92c5acc475897104b4fb06704fde Mon Sep 17 00:00:00 2001 From: Nicolas Hug Date: Mon, 8 Jul 2024 11:51:35 +0100 Subject: [PATCH] Remove reference_video_tensor() fixture --- test/samplers/video_clip_sampler_test.py | 12 +++--------- test/test_utils.py | 6 ------ 2 files changed, 3 insertions(+), 15 deletions(-) diff --git a/test/samplers/video_clip_sampler_test.py b/test/samplers/video_clip_sampler_test.py index 64c8e04e..c5bc4951 100644 --- a/test/samplers/video_clip_sampler_test.py +++ b/test/samplers/video_clip_sampler_test.py @@ -10,10 +10,7 @@ VideoClipSampler, ) -from ..test_utils import ( # noqa: F401; see use in test_sampler - assert_tensor_equal, - reference_video_tensor, -) +from ..test_utils import assert_tensor_equal, NASA_VIDEO @pytest.mark.parametrize( @@ -33,15 +30,12 @@ ), ], ) -def test_sampler( - sampler_args, - reference_video_tensor, # noqa: F811; linter does not see this as a use -): +def test_sampler(sampler_args): torch.manual_seed(0) desired_width, desired_height = 320, 240 video_args = VideoArgs(desired_width=desired_width, desired_height=desired_height) sampler = VideoClipSampler(video_args, sampler_args) - clips = sampler(reference_video_tensor) + clips = sampler(NASA_VIDEO.to_tensor()) assert_tensor_equal(len(clips), sampler_args.clips_per_video) clip = clips[0] if isinstance(sampler_args, TimeBasedSamplerArgs): diff --git a/test/test_utils.py b/test/test_utils.py index 999f20ec..a1345f58 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -5,7 +5,6 @@ from dataclasses import dataclass import numpy as np -import pytest import torch @@ -36,11 +35,6 @@ def _load_tensor_from_file(filename: str) -> torch.Tensor: return torch.load(file_path, weights_only=True) -@pytest.fixture() -def reference_video_tensor() -> torch.Tensor: - return NASA_VIDEO.to_tensor() - - @dataclass class TestContainerFile: filename: str