From 8fe6c28e222d9b7a7cd70aa43acd56e4bcbd22d6 Mon Sep 17 00:00:00 2001 From: Merlin Fisher-Levine Date: Wed, 5 Jun 2024 07:22:14 -0700 Subject: [PATCH 1/2] Fix type error --- python/lsst/summit/extras/logUtils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/lsst/summit/extras/logUtils.py b/python/lsst/summit/extras/logUtils.py index ded5156..83c987d 100644 --- a/python/lsst/summit/extras/logUtils.py +++ b/python/lsst/summit/extras/logUtils.py @@ -208,7 +208,7 @@ def _getFailDataRefs(self) -> list[dafButler.DatasetRef]: fails.append(dataRef) return fails - def _printLineIf(self, logLine: dafButler.ButlerLogRecord) -> None: + def _printLineIf(self, logLine: dafButler.logging.ButlerLogRecord) -> None: """Print the line if the name of the logger isn't in IGNORE_LOGS_FROM. Parameters @@ -225,7 +225,7 @@ def _printLineIf(self, logLine: dafButler.ButlerLogRecord) -> None: self._printFormattedLine(logLine) @staticmethod - def _printFormattedLine(logLine: dafButler.ButlerLogRecord) -> None: + def _printFormattedLine(logLine: dafButler.logging.ButlerLogRecord) -> None: """Print the line, formatted as it would be for a normal task. Parameters From c17a787d8da80824dbbe42bd7ed329141d1f61e1 Mon Sep 17 00:00:00 2001 From: Merlin Fisher-Levine Date: Wed, 5 Jun 2024 07:30:21 -0700 Subject: [PATCH 2/2] Add minimal import-only test for LogBrowser --- tests/test_logUtils.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 tests/test_logUtils.py diff --git a/tests/test_logUtils.py b/tests/test_logUtils.py new file mode 100644 index 0000000..3916e82 --- /dev/null +++ b/tests/test_logUtils.py @@ -0,0 +1,40 @@ +# This file is part of summit_extras. +# +# Developed for the LSST Data Management System. +# This product includes software developed by the LSST Project +# (https://www.lsst.org). +# See the COPYRIGHT file at the top-level directory of this distribution +# for details of code ownership. +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + +import unittest + +import lsst.utils.tests + +# for now, just check that the import isn't broken until we have some test logs +from lsst.summit.extras.logUtils import LogBrowser # noqa: F401 + + +class TestMemory(lsst.utils.tests.MemoryTestCase): + pass + + +def setup_module(module): + lsst.utils.tests.init() + + +if __name__ == "__main__": + lsst.utils.tests.init() + unittest.main()