diff options
-rwxr-xr-x | scripts/serd_bench.py | 5 | ||||
-rw-r--r-- | test/meson.build | 6 | ||||
-rwxr-xr-x | test/run_suite.py | 2 |
3 files changed, 10 insertions, 3 deletions
diff --git a/scripts/serd_bench.py b/scripts/serd_bench.py index 89d34e1f..f3c3e148 100755 --- a/scripts/serd_bench.py +++ b/scripts/serd_bench.py @@ -69,10 +69,11 @@ def parse_time(report): "Return user time and max RSS from a /usr/bin/time -v report" time = memory = None for line in report.split("\n"): + after_colon = line.find(":") + 1 if line.startswith("\tUser time"): - time = float(line[line.find(":") + 1 :]) + time = float(line[after_colon:]) elif line.startswith("\tMaximum resident set"): - memory = float(line[line.find(":") + 1 :]) * 1024 + memory = float(line[after_colon:]) * 1024 return (time, memory) diff --git a/test/meson.build b/test/meson.build index e31ddef3..0104079f 100644 --- a/test/meson.build +++ b/test/meson.build @@ -46,6 +46,12 @@ if get_option('lint') test(name, black, args: black_opts + [script], suite: 'scripts') endforeach endif + + # Check scripts for errors with flake8 + flake8 = find_program('flake8', required: false) + if flake8.found() + test('flake8', flake8, args: python_scripts, suite: 'scripts') + endif endif ################### diff --git a/test/run_suite.py b/test/run_suite.py index 9c3d27ee..3f935fcf 100755 --- a/test/run_suite.py +++ b/test/run_suite.py @@ -47,7 +47,7 @@ def run_eval_test(base_uri, command, in_path, good_path, out_path): command, check=True, encoding="utf-8", stderr=DEVNULL, stdout=PIPE ) - out = [l + "\n" for l in proc.stdout.split("\n")][:-1] + out = [line + "\n" for line in proc.stdout.split("\n")][:-1] with open(good_path, "r", encoding="utf-8") as good: return util.lines_equal(list(good), out, good_path, out_path) |