[Libguestfs] [v2v PATCH 4/6] tests: find all the Python scripts for syntax checks

Pino Toscano ptoscano at redhat.com
Fri Jan 10 15:47:27 UTC 2020


Find all the Python scripts in v2v, instead of hardcoding a list.
---
 v2v/test-v2v-python-syntax.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/v2v/test-v2v-python-syntax.sh b/v2v/test-v2v-python-syntax.sh
index 035d92a2..e2936826 100755
--- a/v2v/test-v2v-python-syntax.sh
+++ b/v2v/test-v2v-python-syntax.sh
@@ -22,14 +22,14 @@ $TEST_FUNCTIONS
 skip_if_skipped
 
 # Files to check.
-files="rhv-upload-createvm.py rhv-upload-plugin.py rhv-upload-precheck.py"
+files="$(find "$srcdir" -name '*.py')"
 
 # Base version of Python.
 python=python3
 
 # Checks the files are syntactically correct, but not very much else.
 for f in $files; do
-    $python -m py_compile "$srcdir/$f"
+    $python -m py_compile "$f"
 done
 
 # Checks the files correspond to PEP8 coding style.
@@ -40,6 +40,6 @@ if $python-pep8 --version >/dev/null 2>&1; then
         # E226 missing whitespace around arithmetic operator
         # E251 unexpected spaces around keyword / parameter equals
         # E302 expected 2 blank lines, found 1
-        $python-pep8 --ignore=E226,E251,E302 "$srcdir/$f"
+        $python-pep8 --ignore=E226,E251,E302 "$f"
     done
 fi
-- 
2.24.1




More information about the Libguestfs mailing list