Skip to content

Commit

Permalink
tests/getRaw.py: Skip test if testdata_decam not found
Browse files Browse the repository at this point in the history
  • Loading branch information
yalsayyad committed Sep 16, 2015
1 parent 4d1f024 commit f6f3bbf
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions tests/getRaw.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,12 @@

import os

import warnings
import unittest
import lsst.utils.tests as utilsTests
from lsst.utils import getPackageDir

import lsst.pex.exceptions as pexExcept
import lsst.daf.persistence as dafPersist
from lsst.obs.decam import DecamMapper

Expand All @@ -37,8 +40,12 @@ class GetRawTestCase(unittest.TestCase):
"""Testing butler raw image retrieval"""

def setUp(self):
datadir = os.getenv("TESTDATA_DECAM_DIR")
assert datadir, "testdata_decam is not setup"
try:
datadir = getPackageDir("testdata_decam")
except pexExcept.NotFoundError:
message = "testdata_decam not setup. Skipping."
warnings.warn(message)
raise unittest.SkipTest(message)
self.butler = dafPersist.Butler(root=os.path.join(datadir, "rawData"))
self.size = (2160, 4146)
self.dataId = {'visit': 237628, 'ccdnum': 10}
Expand Down

0 comments on commit f6f3bbf

Please sign in to comment.