[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 04/31] tests/functional: simplify 'which' implementation
From: |
Daniel P . Berrangé |
Subject: |
[PATCH v2 04/31] tests/functional: simplify 'which' implementation |
Date: |
Wed, 11 Dec 2024 17:26:20 +0000 |
The 'access' check implies the file exists.
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
---
tests/functional/qemu_test/cmd.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tests/functional/qemu_test/cmd.py
b/tests/functional/qemu_test/cmd.py
index 4106f1ee7c..600e0509db 100644
--- a/tests/functional/qemu_test/cmd.py
+++ b/tests/functional/qemu_test/cmd.py
@@ -25,7 +25,7 @@ def which(tool):
paths=os.getenv('PATH')
for p in paths.split(os.path.pathsep):
p = os.path.join(p, tool)
- if os.path.exists(p) and os.access(p, os.X_OK):
+ if os.access(p, os.X_OK):
return p
return None
--
2.46.0
- [PATCH v2 00/31] tests/functional: various improvements wrt assets/scratch files, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 02/31] tests/functional: resolve str(Asset) to cache file path, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 01/31] tests/functional: remove many unused imports, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 03/31] tests/functional: remove duplicated 'which' function impl, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 04/31] tests/functional: simplify 'which' implementation,
Daniel P . Berrangé <=
- [PATCH v2 05/31] tests/functional: drop 'tesseract_available' helper, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 06/31] tests/functional: introduce some helpful decorators, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 07/31] tests/functional: switch to new test skip decorators, Daniel P . Berrangé, 2024/12/11
- [PATCH v2 09/31] tests/functional: add helpers for building file paths, Daniel P . Berrangé, 2024/12/11