av1_videos = {
p
for p in glob.glob("**/*.mp4", recursive=True)
if is_av1_video(p)
}
assert av1_videos == set()
Building a set just to check if it's empty is a bit more complexity than necessary. A more direct way that also bails out early: assert not any(is_av1_video(p) for p in glob.glob("**/*.mp4", recursive=True))
Equivalently (de Morgan's law): assert all(not is_av1_video(p) for p in glob.glob("**/*.mp4", recursive=True))