Skip to content

Commit

Permalink
Skip mp4 test if no ffmpeg found
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr committed Feb 22, 2019
1 parent 3471ff8 commit 1ce1649
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions holoviews/tests/plotting/matplotlib/testrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@
"""
from __future__ import unicode_literals

import os
import sys
import subprocess

from unittest import SkipTest

import numpy as np
Expand Down Expand Up @@ -69,5 +73,11 @@ def test_render_gif(self):
self.assertIn("<img src='data:image/gif", data['text/html'])

def test_render_mp4(self):
if sys.version_info.major > 2:
devnull = subprocess.DEVNULL
else:
devnull = open(os.devnull, 'w')
if not subprocess.call(['ffmpeg', '-h'], stdout=devnull, stderr=devnull):
raise SkipTest('ffmpeg not available, skipping mp4 export test')
data, metadata = self.renderer.components(self.map1, 'mp4')
self.assertIn("<source src='data:video/mp4", data['text/html'])

0 comments on commit 1ce1649

Please sign in to comment.