def mplskip(cls):
 @classmethod
 def setUpClass(cls):
  try:
   import matplotlib as mpl
   mpl.use('Agg', warn=False)
  except ImportError:
   import nose
   raise nose.SkipTest('matplotlib not installed')
 cls.setUpClass = setUpClass
 return cls

def mplskip ( cls ) : @ classmethod def setUpClass ( cls ) : try : import matplotlib as mpl mpl . use ( 'Agg' , warn = False ) except ImportError : import nose raise nose . SkipTest ( 'matplotlib not installed' ) cls . setUpClass = setUpClass return cls
skip a testcase instance if matplotlib isnt installed .