Skip to content

Commit

Permalink
Merge pull request #799 from ioam/tests_conditional_imports
Browse files Browse the repository at this point in the history
Made xarray and iris optional dependencies for dataset tests
  • Loading branch information
philippjfr committed Jul 26, 2016
2 parents e8001b7 + 0b9ed5d commit 8d2d29c
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions tests/testdataset.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 8d2d29c

Please sign in to comment.