Coverage for tests/test_config.py: 62%
24 statements
« prev ^ index » next coverage.py v6.4.1, created at 2022-06-16 11:40 +0000
« prev ^ index » next coverage.py v6.4.1, created at 2022-06-16 11:40 +0000
1#
2# LSST Data Management System
3# Copyright 2008-2017 AURA/LSST.
4#
5# This product includes software developed by the
6# LSST Project (http://www.lsst.org/).
7#
8# This program is free software: you can redistribute it and/or modify
9# it under the terms of the GNU General Public License as published by
10# the Free Software Foundation, either version 3 of the License, or
11# (at your option) any later version.
12#
13# This program is distributed in the hope that it will be useful,
14# but WITHOUT ANY WARRANTY; without even the implied warranty of
15# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16# GNU General Public License for more details.
17#
18# You should have received a copy of the LSST License Statement and
19# the GNU General Public License along with this program. If not,
20# see <http://www.lsstcorp.org/LegalNotices/>.
21#
23import os
24import unittest
25import lsst.utils.tests
27from lsst.pipe.tasks.makeSkyMap import MakeSkyMapConfig
28from lsst.pipe.tasks.multiBand import MergeDetectionsConfig
29from lsst.pipe.tasks.multiBand import MergeMeasurementsConfig
30from lsst.pipe.tasks.processCcd import ProcessCcdConfig
31from lsst.utils import getPackageDir
34class ConfigOverrideTestCase(lsst.utils.tests.TestCase):
35 """Test that config overrides apply without error."""
36 CONFIG_DIR = os.path.join(getPackageDir("obs_cfht"), "config")
38 def testOverrides(self):
39 # Other config overrides at time of writing:
40 #
41 # colorterms.py: Tested implicitly in processCcd.py
42 # singleFrameDriver.py: Requires pipe_drivers, which is not a
43 # dependency of this package.
44 for configClass, overrideFilename in {
45 MakeSkyMapConfig: "makeSkyMap.py",
46 MergeDetectionsConfig: "mergeCoaddDetections.py",
47 MergeMeasurementsConfig: "mergeCoaddMeasurements.py",
48 ProcessCcdConfig: "processCcd.py"
49 }.items():
50 config = configClass()
51 try:
52 config.load(os.path.join(self.CONFIG_DIR, overrideFilename))
53 except AttributeError as e:
54 # A failure to load configuration is a test failure, not an
55 # error, so we convert the exception appropriately.
56 self.fail(e)
59def setup_module(module):
60 lsst.utils.tests.init()
63class MemoryTester(lsst.utils.tests.MemoryTestCase):
64 pass
67if __name__ == "__main__": 67 ↛ 68line 67 didn't jump to line 68, because the condition on line 67 was never true
68 lsst.utils.tests.init()
69 unittest.main()