mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Test testing with pytest
This commit is contained in:
		
							parent
							
								
									341131f812
								
							
						
					
					
						commit
						e30433e4b2
					
				| 
						 | 
					@ -8,7 +8,9 @@ sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-tk\
 | 
				
			||||||
             libharfbuzz-dev libfribidi-dev
 | 
					             libharfbuzz-dev libfribidi-dev
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pip install cffi
 | 
					pip install cffi
 | 
				
			||||||
pip install nose
 | 
					pip install nose  # TODO remove
 | 
				
			||||||
 | 
					pip install pytest
 | 
				
			||||||
 | 
					pip install pytest-cov
 | 
				
			||||||
pip install check-manifest
 | 
					pip install check-manifest
 | 
				
			||||||
pip install olefile
 | 
					pip install olefile
 | 
				
			||||||
pip install pyroma
 | 
					pip install pyroma
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,7 +7,8 @@ python setup.py clean
 | 
				
			||||||
CFLAGS="-coverage" python setup.py build_ext --inplace
 | 
					CFLAGS="-coverage" python setup.py build_ext --inplace
 | 
				
			||||||
 | 
					
 | 
				
			||||||
coverage run --append --include=PIL/* selftest.py
 | 
					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
 | 
					pushd /tmp/check-manifest && check-manifest --ignore ".coveragerc,.editorconfig,*.yml,*.yaml,tox.ini" && popd
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Docs
 | 
					# Docs
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -64,8 +64,9 @@ class PillowTestCase(unittest.TestCase):
 | 
				
			||||||
        try:
 | 
					        try:
 | 
				
			||||||
            ok = self.currentResult.wasSuccessful()
 | 
					            ok = self.currentResult.wasSuccessful()
 | 
				
			||||||
        except AttributeError:  # for nosetests
 | 
					        except AttributeError:  # for nosetests
 | 
				
			||||||
            proxy = self.currentResult
 | 
					            # proxy = self.currentResult
 | 
				
			||||||
            ok = (len(proxy.errors) + len(proxy.failures) == 0)
 | 
					            # ok = (len(proxy.errors) + len(proxy.failures) == 0)
 | 
				
			||||||
 | 
					            ok = True  # TODO pytest
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ok:
 | 
					        if ok:
 | 
				
			||||||
            # only clean out tempfiles if test passed
 | 
					            # only clean out tempfiles if test passed
 | 
				
			||||||
| 
						 | 
					@ -256,8 +257,8 @@ class PillowLeakTestCase(PillowTestCase):
 | 
				
			||||||
            # linux
 | 
					            # linux
 | 
				
			||||||
            # man 2 getrusage
 | 
					            # man 2 getrusage
 | 
				
			||||||
            #        ru_maxrss (since Linux 2.6.32)
 | 
					            #        ru_maxrss (since Linux 2.6.32)
 | 
				
			||||||
            #  This is the maximum resident set size used (in  kilobytes).
 | 
					            #  This is the maximum resident set size used (in kilobytes).
 | 
				
			||||||
            return mem # Kb
 | 
					            return mem  # Kb
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def _test_leak(self, core):
 | 
					    def _test_leak(self, core):
 | 
				
			||||||
        start_mem = self._get_mem_usage()
 | 
					        start_mem = self._get_mem_usage()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user