Coverage for tests/test_ordering.py: 32%

17 statements  

« prev     ^ index     » next       coverage.py v6.5.0, created at 2022-11-09 02:45 -0800

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. 

11 

12import unittest 

13 

14import lsst.utils.tests 

15 

16 

17class TestCaseOrdering(lsst.utils.tests.TestCase): 

18 def testTestOrdering(self): 

19 class DummyTest(lsst.utils.tests.TestCase): 

20 def noOp(self): 

21 pass 

22 

23 class DummyMemoryTest(lsst.utils.tests.MemoryTestCase): 

24 pass 

25 

26 class DummyTest2(unittest.TestCase): 

27 def noOp(self): 

28 pass 

29 

30 suite = unittest.defaultTestLoader.suiteClass( 

31 [DummyTest2("noOp"), DummyMemoryTest("testFileDescriptorLeaks"), DummyTest("noOp")] 

32 ) 

33 

34 self.assertNotIsInstance(suite._tests[0], lsst.utils.tests.MemoryTestCase) 

35 self.assertIsInstance(suite._tests[-1], lsst.utils.tests.MemoryTestCase) 

36 

37 

38if __name__ == "__main__": 38 ↛ 39line 38 didn't jump to line 39, because the condition on line 38 was never true

39 unittest.main()