From 7730287377edfc7ceabfbce0cad5ddffe0580412 Mon Sep 17 00:00:00 2001 From: Tim Jenness Date: Mon, 29 Jul 2024 11:27:14 -0700 Subject: [PATCH] Initialize leak test with setup_module for pytest --- tests/test_astrometryFail.py | 4 ++++ tests/test_calibrate.py | 4 ++++ tests/test_filterLabelFixups.py | 4 ++++ tests/test_lookupFunction.py | 4 ++++ tests/test_psfModelTraceFail.py | 4 ++++ tests/test_schema.py | 4 ++++ 6 files changed, 24 insertions(+) diff --git a/tests/test_astrometryFail.py b/tests/test_astrometryFail.py index 1af8987..6bbf188 100644 --- a/tests/test_astrometryFail.py +++ b/tests/test_astrometryFail.py @@ -139,6 +139,10 @@ class MemoryTester(lsst.utils.tests.MemoryTestCase): pass +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main() diff --git a/tests/test_calibrate.py b/tests/test_calibrate.py index 19dfa95..0bb9b32 100644 --- a/tests/test_calibrate.py +++ b/tests/test_calibrate.py @@ -82,6 +82,10 @@ def testLocalWcsColumns(self): - record['base_LocalWcs_CDMatrix_2_1']*record['base_LocalWcs_CDMatrix_1_2']))) +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main() diff --git a/tests/test_filterLabelFixups.py b/tests/test_filterLabelFixups.py index bf79475..5bde572 100644 --- a/tests/test_filterLabelFixups.py +++ b/tests/test_filterLabelFixups.py @@ -161,6 +161,10 @@ def testReadingBadNewFileWithFullDataId(self): self.assertEqual(calexp.getFilter(), calexpSub.getFilter()) +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main() diff --git a/tests/test_lookupFunction.py b/tests/test_lookupFunction.py index 55c62ec..5e808f8 100644 --- a/tests/test_lookupFunction.py +++ b/tests/test_lookupFunction.py @@ -89,6 +89,10 @@ class MemoryTester(lsst.utils.tests.MemoryTestCase): pass +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main() diff --git a/tests/test_psfModelTraceFail.py b/tests/test_psfModelTraceFail.py index 1d7e85f..a3dab1f 100644 --- a/tests/test_psfModelTraceFail.py +++ b/tests/test_psfModelTraceFail.py @@ -69,6 +69,10 @@ class MemoryTester(lsst.utils.tests.MemoryTestCase): pass +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main() diff --git a/tests/test_schema.py b/tests/test_schema.py index 11643d3..65ad3cb 100644 --- a/tests/test_schema.py +++ b/tests/test_schema.py @@ -65,6 +65,10 @@ def testSourceSchemaMatch(self): self._validateSchema("sourceTable_visit", dataId, "Source") +def setup_module(module): + lsst.utils.tests.init() + + if __name__ == "__main__": lsst.utils.tests.init() unittest.main()