Coverage for tests/test_ordering.py: 27%
15 statements
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-21 09:53 +0000
« prev ^ index » next coverage.py v7.2.7, created at 2023-06-21 09:53 +0000
1# This file is part of utils.
2#
3# Developed for the LSST Data Management System.
4# This product includes software developed by the LSST Project
5# (https://www.lsst.org).
6# See the COPYRIGHT file at the top-level directory of this distribution
7# for details of code ownership.
8#
9# Use of this source code is governed by a 3-clause BSD-style
10# license that can be found in the LICENSE file.
12import unittest
14import lsst.utils.tests
17class TestCaseOrdering(lsst.utils.tests.TestCase):
18 def testTestOrdering(self):
19 class DummyTest(lsst.utils.tests.TestCase):
20 def noOp(self):
21 pass
23 class DummyMemoryTest(lsst.utils.tests.MemoryTestCase):
24 pass
26 class DummyTest2(unittest.TestCase):
27 def noOp(self):
28 pass
30 suite = unittest.defaultTestLoader.suiteClass(
31 [DummyTest2("noOp"), DummyMemoryTest("testFileDescriptorLeaks"), DummyTest("noOp")]
32 )
34 self.assertNotIsInstance(suite._tests[0], lsst.utils.tests.MemoryTestCase)
35 self.assertIsInstance(suite._tests[-1], lsst.utils.tests.MemoryTestCase)
38if __name__ == "__main__":
39 unittest.main()