From 0b9ed5df5a8e1b9956d0801fe327e27b6b0a979d Mon Sep 17 00:00:00 2001 From: jlstevens Date: Tue, 26 Jul 2016 21:12:52 +0100 Subject: [PATCH] Made xarray and iris optional dependencies for dataset tests --- tests/testdataset.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/testdataset.py b/tests/testdataset.py index 058a015eca..a064f3de99 100644 --- a/tests/testdataset.py +++ b/tests/testdataset.py @@ -10,6 +10,8 @@ from collections import OrderedDict from holoviews.core.dimension import OrderedDict as cyODict +from nose.plugins.attrib import attr + try: import pandas as pd except: @@ -508,13 +510,17 @@ def test_dataset_groupby_dynamic(self): +@attr(optional=1) class IrisDatasetTest(GridDatasetTest): """ Tests for Iris interface """ def setUp(self): - import iris + try: + import iris + except: + raise SkipTest("Iris not available") self.restore_datatype = Dataset.datatype Dataset.datatype = ['cube'] self.data_instance_type = iris.cube.Cube @@ -539,14 +545,17 @@ def test_dataset_2D_aggregate_partial_hm(self): def test_dataset_sample_hm(self): pass - +@attr(optional=1) class XArrayDatasetTest(GridDatasetTest): """ Tests for Iris interface """ def setUp(self): - import xarray + try: + import xarray + except: + raise SkipTest("Xarray not available") self.restore_datatype = Dataset.datatype Dataset.datatype = ['xarray'] self.data_instance_type = xarray.Dataset