mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-24 17:06:16 +03:00
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:
parent
31f8da78b7
commit
65cbdae449
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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()
|
||||||
|
|
|
@ -7,7 +7,7 @@ except ImportError:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
class TestPyroma(unittest.TestCase):
|
class TestPyroma(PillowTestCase):
|
||||||
|
|
||||||
def setUp(self):
|
def setUp(self):
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user