Test testing with pytest

This commit is contained in:
hugovk 2017-10-26 08:20:16 +03:00 committed by wiredfool
parent 341131f812
commit e30433e4b2
3 changed files with 10 additions and 6 deletions

View File

@ -8,7 +8,9 @@ sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-tk\
libharfbuzz-dev libfribidi-dev
pip install cffi
pip install nose
pip install nose # TODO remove
pip install pytest
pip install pytest-cov
pip install check-manifest
pip install olefile
pip install pyroma

View File

@ -7,7 +7,8 @@ python setup.py clean
CFLAGS="-coverage" python setup.py build_ext --inplace
coverage run --append --include=PIL/* selftest.py
coverage run --append --include=PIL/* -m nose -vx Tests/test_*.py
# coverage run --append --include=PIL/* -m nose -vx Tests/test_*.py TODO remove
py.test -v --cov PIL --cov-report term Tests
pushd /tmp/check-manifest && check-manifest --ignore ".coveragerc,.editorconfig,*.yml,*.yaml,tox.ini" && popd
# Docs

View File

@ -64,8 +64,9 @@ class PillowTestCase(unittest.TestCase):
try:
ok = self.currentResult.wasSuccessful()
except AttributeError: # for nosetests
proxy = self.currentResult
ok = (len(proxy.errors) + len(proxy.failures) == 0)
# proxy = self.currentResult
# ok = (len(proxy.errors) + len(proxy.failures) == 0)
ok = True # TODO pytest
if ok:
# only clean out tempfiles if test passed
@ -256,8 +257,8 @@ class PillowLeakTestCase(PillowTestCase):
# linux
# man 2 getrusage
# ru_maxrss (since Linux 2.6.32)
# This is the maximum resident set size used (in kilobytes).
return mem # Kb
# This is the maximum resident set size used (in kilobytes).
return mem # Kb
def _test_leak(self, core):
start_mem = self._get_mem_usage()