[elbe-devel] [PATCH 11/19] test_flake8: only call flake8 once

Thomas Weißschuh thomas.weissschuh at linutronix.de
Tue Mar 19 08:47:40 CET 2024


It is much faster than calling flake8 for each file and also allows the
removal of pack_dir.

Signed-off-by: Thomas Weißschuh <thomas.weissschuh at linutronix.de>
---
 elbepack/tests/test_flake8.py | 20 ++++++--------------
 1 file changed, 6 insertions(+), 14 deletions(-)

diff --git a/elbepack/tests/test_flake8.py b/elbepack/tests/test_flake8.py
index 2881ee341862..cddd830d9b21 100644
--- a/elbepack/tests/test_flake8.py
+++ b/elbepack/tests/test_flake8.py
@@ -2,20 +2,12 @@
 # SPDX-License-Identifier: GPL-3.0-or-later
 # SPDX-FileCopyrightText: 2020 Linutronix GmbH
 
-import glob
 import subprocess
 
-from elbepack.directories import elbe_exe, pack_dir
 
-import pytest
-
-
-def _python_files():
-    files = glob.glob(pack_dir + '/**/*.py', recursive=True)
-    files.append(elbe_exe)
-    return files
-
-
- at pytest.mark.parametrize('f', _python_files())
-def test_flake8(f):
-    subprocess.run(['flake8', '--max-line-length=100', '--show-source', f], check=True)
+def test_flake8():
+    subprocess.run([
+        'flake8',
+        '--max-line-length=100', '--show-source',
+        'elbepack',
+    ], check=True)

-- 
2.44.0



More information about the elbe-devel mailing list