Unit test failure
See original GitHub issueself = <test_videoapi.TestVideoApi testMethod=test_frame_reading>
@unittest.skipIf(av is None, "PyAV unavailable")
def test_frame_reading(self):
for test_video, config in test_videos.items():
full_path = os.path.join(VIDEO_DIR, test_video)
av_reader = av.open(full_path)
if av_reader.streams.video:
video_reader = VideoReader(full_path, "video")
for av_frame in av_reader.decode(av_reader.streams.video[0]):
vr_frame = next(video_reader)
self.assertAlmostEqual(
float(av_frame.pts * av_frame.time_base),
vr_frame["pts"],
delta=0.1,
)
av_array = torch.tensor(av_frame.to_rgb().to_ndarray()).permute(
2, 0, 1
)
vr_array = vr_frame["data"]
mean_delta = torch.mean(
torch.abs(av_array.float() - vr_array.float())
)
# on average the difference is very small and caused
# by decoding (around 1%)
# TODO: asses empirically how to set this? atm it's 1%
# averaged over all frames
> self.assertTrue(mean_delta.item() < 2.5)
E AssertionError: False is not true
test/test_videoapi.py:97: AssertionError
cc @bjuncek
Issue Analytics
- State:
- Created 2 years ago
- Comments:14 (11 by maintainers)
Top Results From Across the Web
Why are unit tests failing seen as bad?
A test failure may indicate a planned feature under TDD which isn't yet implemented; or it may indicate a known issue which has...
Read more >How to write good unit tests: Write failing tests first
To write reliable unit tests, always start writing a failing test. And make sure it fails for the right reasons. Follow the Red,...
Read more >unittest — Unit testing framework — Python 3.11.1 ...
Unittest supports skipping individual test methods and even whole classes of tests. In addition, it supports marking a test as an “expected failure,”...
Read more >How do you deal with failing unit tests? [closed] - Stack Overflow
What is the best way do deal with the failing unit tests? What I am currently doing is marking each failing test as...
Read more >The Difference Between Failure and Error in JUnit | Baeldung
Both failure and error in JUnit tests indicate an undesired situation, but their semantics are different. Failures notify of an invalid test ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It seems to me, that the magic elves fixed the issue during the night on the latest master…
Yeah I’m looking at it rn; still wasn’t able to reproduce it in any way; hopefully is something small.