Skip to content

Commit d58bc08

Browse files
thorsten-kleincfriedt
authored andcommitted
scripts: west_commands: rework run_tests.py
reworked run_tests.py script: - removed obsolete arguments from commands called by this script - avoid code duplication by using a for-loop Signed-off-by: Thorsten Klein <[email protected]>
1 parent 54ebd72 commit d58bc08

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

scripts/west_commands/run_tests.py

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,12 @@
2626

2727
here = os.path.abspath(os.path.dirname(__file__))
2828

29-
mypy = [sys.executable, '-m', 'mypy', f'--config-file={here}/mypy.ini',
30-
'--package', 'runners']
31-
pytest = [sys.executable, '-m', 'pytest'] + sys.argv[1:]
29+
mypy = ['mypy', '--package=runners']
30+
pytest = ['pytest'] + sys.argv[1:]
3231

33-
print(f'Running mypy from {here}:\n\t' +
34-
' '.join(shlex.quote(s) for s in mypy),
35-
flush=True)
36-
subprocess.run(mypy, check=True, cwd=here)
37-
print(f'Running pytest from {here}:\n\t' +
38-
' '.join(shlex.quote(s) for s in pytest),
39-
flush=True)
40-
subprocess.run(pytest, check=True, cwd=here)
32+
for cmd in [mypy, pytest]:
33+
command = [sys.executable, '-m'] + cmd
34+
print(f"Running {cmd[0]} in cwd '{here}':\n\t" +
35+
' '.join(shlex.quote(s) for s in command),
36+
flush=True)
37+
subprocess.run(command, check=True, cwd=here)

0 commit comments

Comments
 (0)