diff --git a/test/test_video_reader.py b/test/test_video_reader.py index ffefe40840d..a2c7f7523c6 100644 --- a/test/test_video_reader.py +++ b/test/test_video_reader.py @@ -268,7 +268,8 @@ def _get_video_tensor(video_dir, video_file): """open a video file, and represent the video data by a PT tensor""" full_path = os.path.join(video_dir, video_file) - assert os.path.exists(full_path), "File not found: %s" % full_path + if not os.path.exists(full_path): + raise FileNotFoundError("File not found: %s" % full_path) with open(full_path, "rb") as fp: video_tensor = torch.from_numpy(np.frombuffer(fp.read(), dtype=np.uint8))