Pillow/winbuild/test.py
Jon Dufresne d50445ff30 Introduce isort to automate import ordering and formatting
Similar to the recent adoption of Black. isort is a Python utility to
sort imports alphabetically and automatically separate into sections. By
using isort, contributors can quickly and automatically conform to the
projects style without thinking. Just let the tool do it.

Uses the configuration recommended by the Black to avoid conflicts of
style.

Rewrite TestImageQt.test_deprecated to no rely on import order.
2019-07-06 16:11:35 -07:00

46 lines
1.4 KiB
Python
Executable File

#!/usr/bin/env python3
import glob
import os
import subprocess
import sys
from config import VIRT_BASE, X64_EXT, pythons
def test_one(params):
python, architecture = params
try:
print("Running: %s, %s" % params)
command = [
r"%s\%s%s\Scripts\python.exe" % (VIRT_BASE, python, architecture),
"test-installed.py",
"--processes=-0",
"--process-timeout=30",
]
command.extend(glob.glob("Tests/test*.py"))
proc = subprocess.Popen(command, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
(trace, stderr) = proc.communicate()
status = proc.returncode
print("Done with %s, %s -- %s" % (python, architecture, status))
return (python, architecture, status, trace)
except Exception as msg:
print("Error with %s, %s: %s" % (python, architecture, msg))
return (python, architecture, -1, str(msg))
if __name__ == "__main__":
os.chdir("..")
matrix = [
(python, architecture) for python in pythons for architecture in ("", X64_EXT)
]
results = map(test_one, matrix)
for (python, architecture, status, trace) in results:
print("%s%s: %s" % (python, architecture, status and "ERR" or "PASS"))
res = all(status for (python, architecture, status, trace) in results)
sys.exit(res)