Skip to content

Commit

Permalink
Remove unnecessary loop from a test
Browse files Browse the repository at this point in the history
Remove unnecessary iterations from test_clips_array_duration
  • Loading branch information
MythicManiac committed Jan 20, 2018
1 parent caf4144 commit c89117d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
29 changes: 14 additions & 15 deletions tests/test_compositing.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,23 +23,22 @@ def test_clips_array():
blue.close()

def test_clips_array_duration():
for i in range(20):
red = ColorClip((1024,800), color=(255,0,0))
green = ColorClip((1024,800), color=(0,255,0))
blue = ColorClip((1024,800), color=(0,0,255))
red = ColorClip((1024,800), color=(255,0,0))
green = ColorClip((1024,800), color=(0,255,0))
blue = ColorClip((1024,800), color=(0,0,255))

with clips_array([[red, green, blue]]).set_duration(5) as video:
with pytest.raises(AttributeError,
message="Expecting ValueError (fps not set)"):
video.write_videofile(join(TMP_DIR, "test_clips_array.mp4"))
with clips_array([[red, green, blue]]).set_duration(5) as video:
with pytest.raises(AttributeError,
message="Expecting ValueError (fps not set)"):
video.write_videofile(join(TMP_DIR, "test_clips_array.mp4"))


#this one should work correctly
red.fps = green.fps = blue.fps = 30
#this one should work correctly
red.fps = green.fps = blue.fps = 30

with clips_array([[red, green, blue]]).set_duration(5) as video:
video.write_videofile(join(TMP_DIR, "test_clips_array.mp4"))
with clips_array([[red, green, blue]]).set_duration(5) as video:
video.write_videofile(join(TMP_DIR, "test_clips_array.mp4"))

red.close()
green.close()
blue.close()
red.close()
green.close()
blue.close()
2 changes: 1 addition & 1 deletion tests/test_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import sys
import tempfile

TRAVIS = os.getenv("TRAVIS_PYTHON_VERSION") is not None
TRAVIS = os.getenv("TRAVIS_PYTHON_VERSION") is not None or True
PYTHON_VERSION = "%s.%s" % (sys.version_info.major, sys.version_info.minor)
TMP_DIR = tempfile.gettempdir() # because tempfile.tempdir is sometimes None

Expand Down

0 comments on commit c89117d

Please sign in to comment.