Skip to content

Commit

Permalink
test: Updated asserts in test_io (#1496)
Browse files Browse the repository at this point in the history
* test: Updated asserts in test_io

Updated all raw asserts to corresponding unittest.TestCase.assert. See #1483

* test: Fixed test_io

In order to use unittest.TestCase for asserts in temp_video, the object has to be passed itself to temp_video.

* test: Updated asserts to AssertionError

Switched initial raw assert to AssertionError.

* test: Changed AssertionError for ValueError
  • Loading branch information
frgfm authored and fmassa committed Oct 21, 2019
1 parent 2804c12 commit 371f6c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions test/test_io.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,10 @@ def _create_video_frames(num_frames, height, width):
@contextlib.contextmanager
def temp_video(num_frames, height, width, fps, lossless=False, video_codec=None, options=None):
if lossless:
assert video_codec is None, "video_codec can't be specified together with lossless"
assert options is None, "options can't be specified together with lossless"
if video_codec is not None:
raise ValueError("video_codec can't be specified together with lossless")
if options is not None:
raise ValueError("options can't be specified together with lossless")
video_codec = 'libx264rgb'
options = {'crf': '0'}

Expand Down

0 comments on commit 371f6c8

Please sign in to comment.