From e30433e4b2822c9d19078bd5676a2853c73f5aba Mon Sep 17 00:00:00 2001 From: hugovk Date: Thu, 26 Oct 2017 08:20:16 +0300 Subject: [PATCH] Test testing with pytest --- .travis/install.sh | 4 +++- .travis/script.sh | 3 ++- Tests/helper.py | 9 +++++---- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.travis/install.sh b/.travis/install.sh index 64ce477f7..f1e36bb9c 100755 --- a/.travis/install.sh +++ b/.travis/install.sh @@ -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 diff --git a/.travis/script.sh b/.travis/script.sh index e1d522122..21a70ec7b 100755 --- a/.travis/script.sh +++ b/.travis/script.sh @@ -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 diff --git a/Tests/helper.py b/Tests/helper.py index b8b44b6f2..66f8e9d9d 100644 --- a/Tests/helper.py +++ b/Tests/helper.py @@ -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()