From 496821ab6e220c5ddf43562f097eb5d2ed9a82bc Mon Sep 17 00:00:00 2001 From: velsinki <40809145+velsinki@users.noreply.github.com> Date: Thu, 18 Sep 2025 19:10:16 +0200 Subject: [PATCH] Fix VideoFrame.pts typing in tests Fixes 84859928338bd9c7c42c41e9f7da34873acbffc2 --- tests/test_seek.py | 2 ++ tests/test_videoframe.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/test_seek.py b/tests/test_seek.py index d0e9e1f2e..ac28f6580 100644 --- a/tests/test_seek.py +++ b/tests/test_seek.py @@ -104,6 +104,8 @@ def test_decode_half(self) -> None: frame_count = 0 for frame in container.decode(video_stream): + assert frame.pts is not None + if current_frame is None: current_frame = timestamp_to_frame(frame.pts, video_stream) else: diff --git a/tests/test_videoframe.py b/tests/test_videoframe.py index 90d91ab45..a977cd828 100644 --- a/tests/test_videoframe.py +++ b/tests/test_videoframe.py @@ -32,7 +32,9 @@ def test_frame_duration_matches_packet() -> None: packet_durations.sort(key=lambda x: x[0]) with av.open(fate_suite("h264/interlaced_crop.mp4")) as container: - frame_durations = [(f.pts, f.duration) for f in container.decode(video=0)] + frame_durations = [ + (f.pts, f.duration) for f in container.decode(video=0) if f.pts is not None + ] frame_durations.sort(key=lambda x: x[0]) assert len(packet_durations) == len(frame_durations)