Merge pull request #615 from hugovk/master

Test runner: print out list of failures at end
This commit is contained in:
Alex Clark ☺ 2014-04-11 04:53:50 -04:00
commit 6cd0e1757b
2 changed files with 24 additions and 13 deletions

View File

@ -2,7 +2,12 @@ from __future__ import print_function
# minimal test runner
import glob, os, os.path, sys, tempfile, re
import glob
import os
import os.path
import re
import sys
import tempfile
try:
root = os.path.dirname(__file__)
@ -34,6 +39,7 @@ files.sort()
success = failure = 0
include = [x for x in sys.argv[1:] if x[:2] != "--"]
skipped = []
failed = []
python_options = " ".join(python_options)
tester_options = " ".join(tester_options)
@ -91,7 +97,7 @@ for file in files:
# if there's an ok at the end, it's not really ok
result = result[:-3]
print(result)
failure = failure + 1
failed.append(test)
else:
success = success + 1
@ -105,6 +111,7 @@ if tempfiles:
print(file)
print("-"*68)
def tests(n):
if n == 1:
return "1 test"
@ -112,10 +119,12 @@ def tests(n):
return "%d tests" % n
if skipped:
print("---", tests(len(skipped)), "skipped.")
print(skipped)
if failure:
print("***", tests(failure), "of", (success + failure), "failed.")
print("---", tests(len(skipped)), "skipped:")
print(", ".join(skipped))
if failed:
failure = len(failed)
print("***", tests(failure), "of", (success + failure), "failed:")
print(", ".join(failed))
sys.exit(1)
else:
print(tests(success), "passed.")

View File

@ -2,6 +2,7 @@ from tester import *
from PIL import Image
def verify(im1):
im2 = lena("I")
assert_equal(im1.size, im2.size)
@ -18,6 +19,7 @@ def verify(im1):
return
success()
def test_basic():
# PIL 1.1 has limited support for 16-bit image data. Check that
# create/copy/transform and save works as expected.