[Buildroot] [PATCH v2 6/6] support/testing: fix remaining code style

Ricardo Martincoski ricardo.martincoski at gmail.com
Thu Oct 5 21:42:12 UTC 2017


Fix the remaining code style warnings from flake8:
 - properly indent continuation lines;
 - use proper code to test a parameter is not None.

Cc: Yann E. MORIN <yann.morin.1998 at free.fr>
Signed-off-by: Ricardo Martincoski <ricardo.martincoski at gmail.com>
---
Changes v1 -> v2:
   - renumbered 4 -> 6;
   - keep only a small part of the old patch;
   - use 'if x is not None' instead of 'if x:' (Yann E. MORIN);
   - update commit log.

Number of warnings reported by flake8 for the test infra:
before:   2
after:    0
---
 support/testing/tests/init/base.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/support/testing/tests/init/base.py b/support/testing/tests/init/base.py
index dea46a4473..75cfbe9c59 100644
--- a/support/testing/tests/init/base.py
+++ b/support/testing/tests/init/base.py
@@ -18,7 +18,7 @@ class InitSystemBase(infra.basetest.BRTest):
         else:
             kernel = os.path.join(self.builddir, "images", kernel)
             options.extend(["-dtb", os.path.join(self.builddir, "images",
-                                             "{}.dtb".format(dtb))])
+                                                 "{}.dtb".format(dtb))])
 
         kernel_cmdline = ["root=/dev/mmcblk0",
                           "rootfstype={}".format(fs_type),
@@ -26,7 +26,7 @@ class InitSystemBase(infra.basetest.BRTest):
                           "ro",
                           "console=ttyAMA0"]
 
-        if not init is None:
+        if init is not None:
             kernel_cmdline.extend(["init={}".format(init)])
 
         self.emulator.boot(arch="armv7",
-- 
2.13.0




More information about the buildroot mailing list