diff options
author | David Lord <davidism@gmail.com> | 2018-11-03 15:26:05 -0700 |
---|---|---|
committer | David Lord <davidism@gmail.com> | 2018-11-03 15:31:24 -0700 |
commit | b41c96e00afd09eca075a98589886c78666d4d33 (patch) | |
tree | bf372cf97c44210717b8954919436023f275627b /bench/runbench.py | |
parent | 6247e015ebe0006ee16e69da7aaaba20de18ec94 (diff) | |
download | markupsafe-b41c96e00afd09eca075a98589886c78666d4d33.tar.gz |
add style checks
Diffstat (limited to 'bench/runbench.py')
-rw-r--r-- | bench/runbench.py | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/bench/runbench.py b/bench/runbench.py index ac2cbb1..38cf128 100644 --- a/bench/runbench.py +++ b/bench/runbench.py @@ -3,12 +3,13 @@ Runs the benchmarks """ from __future__ import print_function -import sys + import os import re +import sys from subprocess import Popen -_filename_re = re.compile(r'^bench_(.*?)\.py$') +_filename_re = re.compile(r"^bench_(.*?)\.py$") bench_directory = os.path.abspath(os.path.dirname(__file__)) @@ -18,27 +19,27 @@ def list_benchmarks(): match = _filename_re.match(name) if match is not None: result.append(match.group(1)) - result.sort(key=lambda x: (x.startswith('logging_'), x.lower())) + result.sort(key=lambda x: (x.startswith("logging_"), x.lower())) return result def run_bench(name): - sys.stdout.write('%-32s' % name) + sys.stdout.write("%-32s" % name) sys.stdout.flush() - Popen([sys.executable, '-mtimeit', '-s', - 'from bench_%s import run' % name, - 'run()']).wait() + Popen( + [sys.executable, "-mtimeit", "-s", "from bench_%s import run" % name, "run()"] + ).wait() def main(): - print('=' * 80) - print('Running benchmark for MarkupSafe') - print('-' * 80) + print("=" * 80) + print("Running benchmark for MarkupSafe") + print("-" * 80) os.chdir(bench_directory) for bench in list_benchmarks(): run_bench(bench) - print('-' * 80) + print("-" * 80) -if __name__ == '__main__': +if __name__ == "__main__": main() |