Skip to contentSkip to conversation

tests/functional/ppc/test_ppe42: Fix warning from the latest version of pylint

PATCH In review Thomas Huth 3 participants 3 messages Apr 27

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tests/functional/ppc/test_ppe42: Fix warning from the latest version of pylint

From: Thomas Huth <[email protected]>

The pylint from Fedora 44 found a new issue in this test:

tests/functional/ppc/test_ppe42.py:63:20: W0101: Unreachable code (unreachable)

And indeed, the "break" is unreachable since the previous self.fail() always aborts immediately. Thus let's remove the "break" to make pylint happy again.

---
 tests/functional/ppc/test_ppe42.py | 1 -
 1 file changed, 1 deletion(-)
tests/functional/ppc/test_ppe42.py +0 -1
index 7b360a40a54..53958a7938d 100755
@@ -60,7 +60,6 @@ def _wait_pass_fail(self, timeout):
                     self.log.debug(f"Execution stopped: {e}")
                     self.log.debug("Exiting due to test failure")
                     self.fail("Failure detected!")
-                    break
             else:
                 self.fail("Timed out waiting for test completion.")
 
Signature · 1 line
2.53.0
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The pylint from Fedora 44 found a new issue in this test:

tests/functional/ppc/test_ppe42.py:63:20: W0101: Unreachable code (unreachable)

Quoted 8 lines

And indeed, the "break" is unreachable since the previous self.fail() always aborts immediately. Thus let's remove the "break" to make pylint happy again.

---
  tests/functional/ppc/test_ppe42.py | 1 -
  1 file changed, 1 deletion(-)
Reviewed-by on v1 1/1
#2 lore raw
In reply to Thomas Huth

Thanks,

Glenn

Quoted 27 lines · Thomas Huth

From: Thomas Huth <[email protected]>

The pylint from Fedora 44 found a new issue in this test:

tests/functional/ppc/test_ppe42.py:63:20: W0101: Unreachable code (unreachable)

And indeed, the "break" is unreachable since the previous self.fail() always aborts immediately. Thus let's remove the "break" to make pylint happy again.

---
 tests/functional/ppc/test_ppe42.py | 1 -
 1 file changed, 1 deletion(-)
tests/functional/ppc/test_ppe42.py +0 -1
index 7b360a40a54..53958a7938d 100755
@@ -60,7 +60,6 @@ def _wait_pass_fail(self, timeout):
                     self.log.debug(f"Execution stopped: {e}")
                     self.log.debug("Exiting due to test failure")
                     self.fail("Failure detected!")
-                    break
             else:
                 self.fail("Timed out waiting for test completion.")