public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH 1/1] test: fix pylint warnings in test_env.py
@ 2021-11-26 22:30 Heinrich Schuchardt
  2022-01-25 15:57 ` Tom Rini
  0 siblings, 1 reply; 2+ messages in thread
From: Heinrich Schuchardt @ 2021-11-26 22:30 UTC (permalink / raw)
  To: Tom Rini; +Cc: Simon Glass, Andy Shevchenko, u-boot, Heinrich Schuchardt

* assert does not need parentheses
* add module docstring
* fix misspelled constant True
* limit lines to 100 characters

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
---
 test/py/tests/test_env.py | 20 ++++++++++++--------
 1 file changed, 12 insertions(+), 8 deletions(-)

diff --git a/test/py/tests/test_env.py b/test/py/tests/test_env.py
index 9bed2f48d7..39fad4194b 100644
--- a/test/py/tests/test_env.py
+++ b/test/py/tests/test_env.py
@@ -2,11 +2,13 @@
 # Copyright (c) 2015 Stephen Warren
 # Copyright (c) 2015-2016, NVIDIA CORPORATION. All rights reserved.
 
-# Test operation of shell commands relating to environment variables.
+"""
+Test operation of shell commands relating to environment variables.
+"""
 
 import os
 import os.path
-from subprocess import call, check_call, CalledProcessError
+from subprocess import call, CalledProcessError
 
 import pytest
 import u_boot_utils
@@ -191,7 +193,7 @@ def test_env_printenv_non_existent(state_test_env):
     c = state_test_env.u_boot_console
     with c.disable_check('error_notification'):
         response = c.run_command('printenv %s' % var)
-    assert(response == '## Error: "%s" not defined' % var)
+    assert response == '## Error: "%s" not defined' % var
 
 @pytest.mark.buildconfigspec('cmd_echo')
 def test_env_unset_non_existent(state_test_env):
@@ -256,7 +258,7 @@ def test_env_import_checksum_no_size(state_test_env):
 
     with c.disable_check('error_notification'):
         response = c.run_command('env import -c %s -' % addr)
-    assert(response == '## Error: external checksum format must pass size')
+    assert response == '## Error: external checksum format must pass size'
 
 @pytest.mark.buildconfigspec('cmd_importenv')
 def test_env_import_whitelist_checksum_no_size(state_test_env):
@@ -269,7 +271,7 @@ def test_env_import_whitelist_checksum_no_size(state_test_env):
 
     with c.disable_check('error_notification'):
         response = c.run_command('env import -c %s - foo1 foo2 foo4' % addr)
-    assert(response == '## Error: external checksum format must pass size')
+    assert response == '## Error: external checksum format must pass size'
 
 @pytest.mark.buildconfigspec('cmd_exportenv')
 @pytest.mark.buildconfigspec('cmd_importenv')
@@ -358,12 +360,14 @@ def test_env_info(state_test_env):
             assert '= true' in l or '= false' in l
             nb_line += 1
         else:
-            assert true
+            assert True
     assert nb_line == 3
 
     response = c.run_command('env info -p -d')
-    assert 'Default environment is used' in response or "Environment was loaded from persistent storage" in response
-    assert 'Environment can be persisted' in response or "Environment cannot be persisted" in response
+    assert 'Default environment is used' in response or \
+           "Environment was loaded from persistent storage" in response
+    assert 'Environment can be persisted' in response or \
+           "Environment cannot be persisted" in response
 
     response = c.run_command('env info -p -d -q')
     assert response == ""
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH 1/1] test: fix pylint warnings in test_env.py
  2021-11-26 22:30 [PATCH 1/1] test: fix pylint warnings in test_env.py Heinrich Schuchardt
@ 2022-01-25 15:57 ` Tom Rini
  0 siblings, 0 replies; 2+ messages in thread
From: Tom Rini @ 2022-01-25 15:57 UTC (permalink / raw)
  To: Heinrich Schuchardt; +Cc: Simon Glass, Andy Shevchenko, u-boot

[-- Attachment #1: Type: text/plain, Size: 332 bytes --]

On Fri, Nov 26, 2021 at 11:30:27PM +0100, Heinrich Schuchardt wrote:

> * assert does not need parentheses
> * add module docstring
> * fix misspelled constant True
> * limit lines to 100 characters
> 
> Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>

Applied to u-boot/master, thanks!

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-25 15:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-11-26 22:30 [PATCH 1/1] test: fix pylint warnings in test_env.py Heinrich Schuchardt
2022-01-25 15:57 ` Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox