Skip to content

Commit

Permalink
Skip annotate3d if no pims installed
Browse files Browse the repository at this point in the history
  • Loading branch information
caspervdw committed Apr 16, 2018
1 parent d35aa57 commit cd3b8a5
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions trackpy/tests/test_plots.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,26 @@
from trackpy.utils import suppress_plotting, fit_powerlaw
from trackpy.tests.common import StrictTestCase

import nose
# Quiet warnings about Axes not being compatible with tight_layout
import warnings
warnings.filterwarnings("ignore", message="This figure includes Axes that are not compatible with tight_layout")

path, _ = os.path.split(os.path.abspath(__file__))

try:
import pims
except ImportError:
PIMS_AVAILABLE = False
else:
PIMS_AVAILABLE = True


def _skip_if_no_pims():
if not PIMS_AVAILABLE:
raise nose.SkipTest('PIMS not installed. Skipping.')


class TestPlots(StrictTestCase):
def setUp(self):
# older matplotlib may raise an invalid error
Expand Down Expand Up @@ -89,6 +103,7 @@ def test_annotate(self):
self.assertRaises(ValueError, bad_call)

def test_annotate3d(self):
_skip_if_no_pims()
suppress_plotting()
f = DataFrame({'x': [0, 1], 'y': [0, 1], 'z': [0, 1], 'frame': [0, 0],
'mass': [10, 20]})
Expand Down

0 comments on commit cd3b8a5

Please sign in to comment.