Skip to content

Commit

Permalink
Reset filter list before running each test
Browse files Browse the repository at this point in the history
Without this, in pytest,  when CFHT tests run they define a "u" filter,
and when the DECam tests run they fail because the "u" filter
has already been defined.
  • Loading branch information
timj committed Aug 23, 2017
1 parent 9041cab commit 643042e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/jointcalTestBase.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import inspect

import lsst.afw.geom
import lsst.afw.image.utils
from lsst.meas.extensions.astrometryNet import LoadAstrometryNetObjectsTask, LoadAstrometryNetObjectsConfig

from lsst.jointcal import jointcal, utils
Expand Down Expand Up @@ -70,6 +71,10 @@ def setUp_base(self, center, radius,
# Append `msg` arguments to assert failures.
self.longMessage = True

# Ensure that the filter list is reset for each test so that we avoid
# confusion or contamination from other instruments.
lsst.afw.image.utils.resetFilters()

def tearDown(self):
if getattr(self, 'reference', None) is not None:
del self.reference
Expand Down

0 comments on commit 643042e

Please sign in to comment.