Commit 4779233a authored by di68kap's avatar di68kap
Browse files

- test/run.py now runs tests concurrently

parent 25ed1f6c
......@@ -2,10 +2,11 @@
"""Runs the dhparser test-suite with several installed interpreters"""
import multiprocessing
import concurrent.futures
import os
import platform
import threading
import time
def run_tests(testtype, command):
......@@ -38,7 +39,9 @@ if __name__ == "__main__":
cwd = os.getcwd()
os.chdir(scriptdir + '/..')
with multiprocessing.Pool() as pool:
timestamp = time.time()
with concurrent.futures.ProcessPoolExecutor(4) as pool:
for interpreter in interpreters:
os.system(interpreter + '--version')
......@@ -55,4 +58,7 @@ if __name__ == "__main__":
and filename not in ["foreign_typing.py", "stringview.py", "__init__.py"]]
pool.map(run_doctests, commands)
elapsed = time.time() - timestamp
print('\n Test-Duration: %.2f seconds' % elapsed)
os.chdir(cwd)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment