Skip to content

Commit c1b3adc

Browse files
committed
use pytest.approx
1 parent e504970 commit c1b3adc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/test_encoders.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,9 +1225,9 @@ def test_fractional_frame_rate(self, tmp_path, frame_rate):
12251225
metadata = self._get_video_metadata(output_path, fields=["r_frame_rate"])
12261226
num, den = metadata["r_frame_rate"].split("/")
12271227
encoded_frame_rate = int(num) / int(den)
1228-
assert encoded_frame_rate == frame_rate
1228+
assert encoded_frame_rate == pytest.approx(frame_rate, abs=1e-3)
12291229
# Assert the decoded frame rate matches the input frame rate
12301230
_decoded_frames, decoded_frame_rate = self.decode_and_get_frame_rate(
12311231
output_path
12321232
)
1233-
assert decoded_frame_rate == frame_rate
1233+
assert decoded_frame_rate == pytest.approx(frame_rate, abs=1e-3)

0 commit comments

Comments
 (0)