Run nose in verbose mode so we can see the tests being run/skipped. Override __str__ in PillowTestCase for nicer output, and make sure all tests are derived from PillowTestCase.

This commit is contained in:
hugovk 2014-07-19 18:46:12 +03:00
parent 31f8da78b7
commit 65cbdae449
4 changed files with 9 additions and 5 deletions

View File

@ -33,11 +33,11 @@ script:
# Don't cover PyPy: it fails intermittently and is x5.8 slower (#640) # Don't cover PyPy: it fails intermittently and is x5.8 slower (#640)
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time python selftest.py; fi - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time python selftest.py; fi
- if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time nosetests Tests/test_*.py; fi - if [ "$TRAVIS_PYTHON_VERSION" == "pypy" ]; then time nosetests -v Tests/test_*.py; fi
# Cover the others # Cover the others
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* selftest.py; fi - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* selftest.py; fi
- if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* -m nose Tests/test_*.py; fi - if [ "$TRAVIS_PYTHON_VERSION" != "pypy" ]; then time coverage run --append --include=PIL/* -m nose -v Tests/test_*.py; fi
after_success: after_success:
- coverage report - coverage report

View File

@ -19,6 +19,10 @@ class PillowTestCase(unittest.TestCase):
# holds last result object passed to run method: # holds last result object passed to run method:
self.currentResult = None self.currentResult = None
# Nicer output for --verbose
def __str__(self):
return self.__class__.__name__ + "." + self._testMethodName
def run(self, result=None): def run(self, result=None):
self.currentResult = result # remember result for use later self.currentResult = result # remember result for use later
unittest.TestCase.run(self, result) # call superclass run method unittest.TestCase.run(self, result) # call superclass run method

View File

@ -1,7 +1,7 @@
from helper import unittest, lena from helper import unittest, PillowTestCase, lena
class TestImageToBytes(unittest.TestCase): class TestImageToBytes(PillowTestCase):
def test_sanity(self): def test_sanity(self):
data = lena().tobytes() data = lena().tobytes()

View File

@ -7,7 +7,7 @@ except ImportError:
pass pass
class TestPyroma(unittest.TestCase): class TestPyroma(PillowTestCase):
def setUp(self): def setUp(self):
try: try: