Coverage for tests/testModuleImporter2.py: 82%
9 statements
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-20 03:37 -0700
« prev ^ index » next coverage.py v7.4.4, created at 2024-03-20 03:37 -0700
1#!/usr/bin/env python
2#
3# LSST Data Management System
4# Copyright 2008, 2009, 2010 LSST Corporation.
5#
6# This product includes software developed by the
7# LSST Project (http://www.lsst.org/).
8#
9# This program is free software: you can redistribute it and/or modify
10# it under the terms of the GNU General Public License as published by
11# the Free Software Foundation, either version 3 of the License, or
12# (at your option) any later version.
13#
14# This program is distributed in the hope that it will be useful,
15# but WITHOUT ANY WARRANTY; without even the implied warranty of
16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17# GNU General Public License for more details.
18#
19# You should have received a copy of the LSST License Statement and
20# the GNU General Public License along with this program. If not,
21# see <http://www.lsstcorp.org/LegalNotices/>.
22#
24import unittest
25import testModuleImporterLib
28class ModuleImporterTestCase(unittest.TestCase):
30 def testImporter(self):
31 # Before we import lsst, the functionality to import Python modules
32 # from C++ should not work.
33 self.assertFalse(testModuleImporterLib.doImport("math"))
34 # ...but after we import lsst.base.cppimport, it should.`
35 import lsst.base.cppimport # noqa F401
36 self.assertTrue(testModuleImporterLib.doImport("math"))
39if __name__ == "__main__": 39 ↛ 40line 39 didn't jump to line 40, because the condition on line 39 was never true
40 unittest.main()