From bd38f3c2897c3f82f8c10464f70ed301c618dae7 Mon Sep 17 00:00:00 2001 From: Patrik Teivonen Date: Tue, 2 Aug 2022 12:30:49 +0300 Subject: Use logging functions from logging_util.py -Remove inconsistent print function/logging module usage across scripts -Initialize logger from logging_util.py -Use CI friendly format in logging to stdout -Log file format with extra debug information (script, line, process) -Remove rainbow_logging_handler in favor of colorlog -Remove unnecessary print/log functions from unit tests -Remove unnecessary whitespace in logging messages Change-Id: Ib913cf2f6a2b02e06628f94dceeeaf845191b96b Reviewed-by: Antti Kokko --- packaging-tools/tests/test_build_wrapper.py | 1 - packaging-tools/tests/test_packaging.py | 4 ++-- packaging-tools/tests/test_release_repo_updater.py | 1 - 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'packaging-tools/tests') diff --git a/packaging-tools/tests/test_build_wrapper.py b/packaging-tools/tests/test_build_wrapper.py index 036bd1d0e..1834f9868 100644 --- a/packaging-tools/tests/test_build_wrapper.py +++ b/packaging-tools/tests/test_build_wrapper.py @@ -68,7 +68,6 @@ class TestBuildWrapper(unittest.TestCase): remote_path_base = os.path.join(temp_dir, project_name, version_branch) remote_path_snapshot_dir = os.path.join(remote_path_base, build_number) remote_path_latest_link = os.path.join(remote_path_base, 'latest') - print(remote_path_latest_link) self.assertTrue(os.path.isdir(remote_path_base)) self.assertTrue(os.path.isdir(remote_path_snapshot_dir)) self.assertTrue(os.path.islink(remote_path_latest_link)) diff --git a/packaging-tools/tests/test_packaging.py b/packaging-tools/tests/test_packaging.py index c31f33a59..b466d9f8e 100755 --- a/packaging-tools/tests/test_packaging.py +++ b/packaging-tools/tests/test_packaging.py @@ -141,8 +141,8 @@ class TestPackaging(unittest.TestCase): idx = 0 for line in FileInput(temp_file, inplace=False): - print(f"Received data: [{line.strip()}] expected data: [{expected_data[idx]}]") - self.assertEqual(line.strip(), expected_data[idx], f"Received data: [{line}] differs from expected data: [{expected_data[idx]}]") + msg = f"Received data: [{line}] differs from expected data: [{expected_data[idx]}]" + self.assertEqual(line.strip(), expected_data[idx], msg) idx += 1 finally: rmtree(temp_dir) diff --git a/packaging-tools/tests/test_release_repo_updater.py b/packaging-tools/tests/test_release_repo_updater.py index bd2708dc5..9c5b2cbcf 100755 --- a/packaging-tools/tests/test_release_repo_updater.py +++ b/packaging-tools/tests/test_release_repo_updater.py @@ -272,7 +272,6 @@ class TestReleaseRepoUpdater(unittest.TestCase): ([""], [""]) ) async def test_format_task_filters(self, task_filters: List[str], exp_result: bool) -> None: - print("test") self.assertEqual(format_task_filters(task_filters), exp_result) @asyncio_test_parallel_data( # type: ignore -- cgit v1.2.3