From patchwork Sat Jan 10 23:56:21 2026 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1480 Return-Path: X-Original-To: u-boot-concept@u-boot.org Delivered-To: u-boot-concept@u-boot.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089461; bh=GENWpnRRwQi9xevPMpgEU9b0se3pBPwlX9hMKGTmVAg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=odjnzKOf1JIyApVRWFVDOL5SMFYlc87ODGnww9Pgff8OwmLqnhFjnFPMwvjGW1Uf1 7PYPxpn0Xd2jk/ZLXy824BJucSEekjDl52iqahcTexamjCCCeheyN/TqrZAbZH0M09 IGvSkG8GWeeQM9PAHexuEOwAZ7jZHLMm7rmRDjaiKFsCKt+PNh0j4+MApFxSTjMwTV nV4XN8Tzymdhi94CRWve0/MUE5wggmMui80SspsdMkGj3NE0DDXGaGaWGrVQFVZbnK 8Zd6+a5A2eXU9/FE5F6oxok3SehpYP6OA4cLkzROpWbRxl6QcYyAMAVVZrPnbfChVG agxFYApTAuk6A== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 6C9CB692AE for ; Sat, 10 Jan 2026 16:57:41 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10024) with ESMTP id LhEyJUNxxGS2 for ; Sat, 10 Jan 2026 16:57:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089461; bh=GENWpnRRwQi9xevPMpgEU9b0se3pBPwlX9hMKGTmVAg=; h=From:To:Date:In-Reply-To:References:CC:Subject:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=odjnzKOf1JIyApVRWFVDOL5SMFYlc87ODGnww9Pgff8OwmLqnhFjnFPMwvjGW1Uf1 7PYPxpn0Xd2jk/ZLXy824BJucSEekjDl52iqahcTexamjCCCeheyN/TqrZAbZH0M09 IGvSkG8GWeeQM9PAHexuEOwAZ7jZHLMm7rmRDjaiKFsCKt+PNh0j4+MApFxSTjMwTV nV4XN8Tzymdhi94CRWve0/MUE5wggmMui80SspsdMkGj3NE0DDXGaGaWGrVQFVZbnK 8Zd6+a5A2eXU9/FE5F6oxok3SehpYP6OA4cLkzROpWbRxl6QcYyAMAVVZrPnbfChVG agxFYApTAuk6A== Received: from mail.u-boot.org (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 5B430692B0 for ; Sat, 10 Jan 2026 16:57:41 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089458; bh=xRUOkutnf/79gQryE1Anh3I4J3PyW780LS1cob1w7x4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=O34q2xgRsCN/pKGo2zK7bnKSK1XclHYxYKcfkV6S4Im42f1FDF9saRDQBbY7FA3Fn yMGWtdXmRBEL9Fyj3uCKhF0z4sYwAXamOFyRpMfmN7W8g4yWcCsFlZC80xZ8WPWcTF pX8rE7e0Cuj+OGScz5+FU+Id0FSiw92OP804A5of41iwuKlKnYQNdlJodh3wo6S/3X oY7LoJlXXj26u1MN/HwQI6XwGICzd4NwQZk1Rf7v0hmcV0UJ4rgWgT3Kq9AO/LM53y CMVjrgxWhVYkn+DEfB0xkjDNr4nHS9BZAyRMRczWEUENG061AvVncxxZR/AGZXjMia Dg3VcCwmNEzCA== Received: from localhost (localhost [127.0.0.1]) by mail.u-boot.org (Postfix) with ESMTP id 610A9692AE; Sat, 10 Jan 2026 16:57:38 -0700 (MST) X-Virus-Scanned: Debian amavis at Received: from mail.u-boot.org ([127.0.0.1]) by localhost (mail.u-boot.org [127.0.0.1]) (amavis, port 10026) with ESMTP id pI0AhuCFdXwo; Sat, 10 Jan 2026 16:57:38 -0700 (MST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=u-boot.org; s=default; t=1768089454; bh=91TzdiIzrw9QATzCIvoS6cCFFRYhS94SheS6QRPMDLQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pDKulkLX3x+3thOGWqugazM0emoZiMjxY6c5h+ANU3ED25JEHiLfZhEzzkdDQkTZ5 /qArIoUqeDKnM9C98hcn7cpgnHU6mVtHW+0vEh1yY2SimQ2zsgS8PQN/kuXfSrSssr RPNdP0xRam7hdgwrN3qI7SdFOsJ78xuPy8ET3RHWVj1FjmGSnGZkp/Rwb9mP3If+EB 6tXvZcekQ6qQY4K0P2fiiv65cNpOInOo9+zP0YRlbJKgMJQaIKkgIB7zpUetk0jYaL OFnXDlbBm5LSviyxSzAPl7Hkf6AyTTuq6YpWn9Zk9vtCwcLmj0BskDLYo8EQdgi+gH mGYEh1F1X8TVw== Received: from u-boot.org (unknown [73.34.74.121]) by mail.u-boot.org (Postfix) with ESMTPSA id 0BF4769186; Sat, 10 Jan 2026 16:57:33 -0700 (MST) From: Simon Glass To: U-Boot Concept Date: Sat, 10 Jan 2026 16:56:21 -0700 Message-ID: <20260110235633.1064859-9-sjg@u-boot.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260110235633.1064859-1-sjg@u-boot.org> References: <20260110235633.1064859-1-sjg@u-boot.org> MIME-Version: 1.0 Message-ID-Hash: PETTQXJU7P4BQP4P7MSNFUMC5PUQ4N25 X-Message-ID-Hash: PETTQXJU7P4BQP4P7MSNFUMC5PUQ4N25 X-MailFrom: sjg@u-boot.org X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; loop; banned-address; emergency; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: Simon Glass , "Claude Opus 4 . 5" X-Mailman-Version: 3.3.10 Precedence: list Subject: [Concept] [PATCH 08/14] buildman: Add missing docstrings in func_test List-Id: Discussion and patches related to U-Boot Concept Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Simon Glass Add module docstring and function docstrings for setup_toolchains(), test_full_help(), test_help(), and print_lines(). This fixes pylint C0114 and C0116 warnings. Co-developed-by: Claude Opus 4.5 Signed-off-by: Simon Glass --- tools/buildman/func_test.py | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/tools/buildman/func_test.py b/tools/buildman/func_test.py index ad60b814e1a..1817bf95485 100644 --- a/tools/buildman/func_test.py +++ b/tools/buildman/func_test.py @@ -2,6 +2,12 @@ # Copyright (c) 2014 Google, Inc # +"""Functional tests for buildman + +These tests run buildman with mocked commands to verify its behavior +without actually building anything. +""" + import io import os from pathlib import Path @@ -230,6 +236,7 @@ class TestFunctional(unittest.TestCase): shutil.rmtree(self._output_dir) def setup_toolchains(self): + """Set up toolchains for testing""" self._toolchains = toolchain.Toolchains() self._toolchains.add('gcc', test=False) @@ -268,6 +275,7 @@ class TestFunctional(unittest.TestCase): return result def test_full_help(self): + """Test that -H shows the full README.rst file""" command.TEST_RESULT = None result = self._run_buildman('-H') help_file = os.path.join(self._buildman_dir, 'README.rst') @@ -279,6 +287,7 @@ class TestFunctional(unittest.TestCase): self.assertEqual(0, result.return_code) def test_help(self): + """Test that -h shows help text""" command.TEST_RESULT = None result = self._run_buildman('-h') help_file = os.path.join(self._buildman_dir, 'README.rst') @@ -536,8 +545,12 @@ Some images are invalid''' print('_handle_make failure: make', stage) sys.exit(1) - # Example function to print output lines def print_lines(self, lines): + """Print output lines for debugging tests + + Args: + lines (list of str): Lines to print + """ print(len(lines)) for line in lines: print(line) @@ -1524,7 +1537,15 @@ something: me call_count = [0] config_exists = [False] - def mock_kconfig_changed(fname, srcdir='.', target=None): + def mock_kconfig_changed(fname, _srcdir='.', _target=None): + """Mock for kconfig_changed_since that checks if .config exists + + Args: + fname (str): Path to the .config file + + Returns: + bool: True if .config exists, False otherwise + """ call_count[0] += 1 # Return True only if .config exists (i.e. not the first build) # The first build has no .config to compare against @@ -1553,7 +1574,12 @@ something: me """Test that -Z flag disables Kconfig change detection""" call_count = [0] - def mock_kconfig_changed(fname, srcdir='.', target=None): + def mock_kconfig_changed(_fname, _srcdir='.', _target=None): + """Mock for kconfig_changed_since that always returns True + + Returns: + bool: Always True + """ call_count[0] += 1 return True # Would trigger reconfig if checking was enabled