mirror of
				https://github.com/python-pillow/Pillow.git
				synced 2025-11-04 01:47:47 +03:00 
			
		
		
		
	Test with coverage on Windows, update 'setup.py test'
This commit is contained in:
		
							parent
							
								
									db760c1284
								
							
						
					
					
						commit
						3515ae3d9e
					
				
							
								
								
									
										9
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										9
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							| 
						 | 
					@ -6,6 +6,7 @@ __pycache__/
 | 
				
			||||||
*.so
 | 
					*.so
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Distribution / packaging
 | 
					# Distribution / packaging
 | 
				
			||||||
 | 
					.eggs/
 | 
				
			||||||
.Python
 | 
					.Python
 | 
				
			||||||
env/
 | 
					env/
 | 
				
			||||||
bin/
 | 
					bin/
 | 
				
			||||||
| 
						 | 
					@ -69,3 +70,11 @@ docs/_build/
 | 
				
			||||||
#OS
 | 
					#OS
 | 
				
			||||||
.DS_Store
 | 
					.DS_Store
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# JetBrains
 | 
				
			||||||
 | 
					.idea
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# Extra test images installed from pillow-depends/test_images
 | 
				
			||||||
 | 
					Tests/images/README.md
 | 
				
			||||||
 | 
					Tests/images/msp
 | 
				
			||||||
 | 
					Tests/images/picins
 | 
				
			||||||
 | 
					Tests/images/sunraster
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,12 +7,12 @@ sudo apt-get -qq install libfreetype6-dev liblcms2-dev python-tk\
 | 
				
			||||||
			 python-qt4 ghostscript libffi-dev libjpeg-turbo-progs cmake imagemagick\
 | 
								 python-qt4 ghostscript libffi-dev libjpeg-turbo-progs cmake imagemagick\
 | 
				
			||||||
             libharfbuzz-dev libfribidi-dev
 | 
					             libharfbuzz-dev libfribidi-dev
 | 
				
			||||||
 | 
					
 | 
				
			||||||
pip install check-manifest
 | 
					 | 
				
			||||||
pip install cffi
 | 
					pip install cffi
 | 
				
			||||||
 | 
					pip install check-manifest
 | 
				
			||||||
pip install coverage
 | 
					pip install coverage
 | 
				
			||||||
pip install olefile
 | 
					pip install olefile
 | 
				
			||||||
pip install pytest
 | 
					pip install -U pytest
 | 
				
			||||||
pip install pytest-cov
 | 
					pip install -U pytest-cov
 | 
				
			||||||
pip install pyroma
 | 
					pip install pyroma
 | 
				
			||||||
pip install test-image-results
 | 
					pip install test-image-results
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -6,8 +6,8 @@ coverage erase
 | 
				
			||||||
python setup.py clean
 | 
					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
 | 
					python selftest.py
 | 
				
			||||||
python -m pytest -vx --cov PIL --cov-append --cov-report term Tests
 | 
					python setup.py test
 | 
				
			||||||
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
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										7
									
								
								Makefile
									
									
									
									
									
								
							
							
						
						
									
										7
									
								
								Makefile
									
									
									
									
									
								
							| 
						 | 
					@ -15,12 +15,9 @@ co:
 | 
				
			||||||
    done
 | 
					    done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
coverage:
 | 
					coverage:
 | 
				
			||||||
	coverage erase
 | 
						python selftest.py
 | 
				
			||||||
	coverage run --parallel-mode --include=PIL/* selftest.py
 | 
						python setup.py test
 | 
				
			||||||
	python -m pytest --cov PIL --cov-append --cov-report html Tests
 | 
					 | 
				
			||||||
# Doesn't combine properly before report, writing report instead of displaying invalid report.
 | 
					 | 
				
			||||||
	rm -r htmlcov || true
 | 
						rm -r htmlcov || true
 | 
				
			||||||
	coverage combine
 | 
					 | 
				
			||||||
	coverage report
 | 
						coverage report
 | 
				
			||||||
 | 
					
 | 
				
			||||||
doc:
 | 
					doc:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -74,8 +74,13 @@ build_script:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test_script:
 | 
					test_script:
 | 
				
			||||||
- cd c:\pillow
 | 
					- cd c:\pillow
 | 
				
			||||||
- '%PYTHON%\%PIP_DIR%\pip.exe install nose'
 | 
					- '%PYTHON%\%PIP_DIR%\pip.exe install pytest pytest-cov'
 | 
				
			||||||
- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%'
 | 
					- '%PYTHON%\%EXECUTABLE% -m pytest -vx --cov PIL --cov-append --cov-report term --cov-report xml Tests'
 | 
				
			||||||
 | 
					#- '%PYTHON%\%EXECUTABLE% test-installed.py -v -s %TEST_OPTIONS%' TODO TEST_OPTIONS with pytest?
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					after_test:
 | 
				
			||||||
 | 
					- pip install codecov
 | 
				
			||||||
 | 
					- codecov --file coverage.xml --name %PYTHON%
 | 
				
			||||||
 | 
					
 | 
				
			||||||
matrix:
 | 
					matrix:
 | 
				
			||||||
  fast_finish: true
 | 
					  fast_finish: true
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,2 +1,6 @@
 | 
				
			||||||
 | 
					[aliases]
 | 
				
			||||||
 | 
					test=pytest
 | 
				
			||||||
[metadata]
 | 
					[metadata]
 | 
				
			||||||
license_file = LICENSE
 | 
					license_file = LICENSE
 | 
				
			||||||
 | 
					[tool:pytest]
 | 
				
			||||||
 | 
					addopts = -vx --cov PIL --cov-append --cov-report term Tests
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										6
									
								
								setup.py
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								setup.py
									
									
									
									
									
								
							| 
						 | 
					@ -751,6 +751,9 @@ def debug_build():
 | 
				
			||||||
    return hasattr(sys, 'gettotalrefcount')
 | 
					    return hasattr(sys, 'gettotalrefcount')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
 | 
				
			||||||
 | 
					pytest_runner = ['pytest-runner'] if needs_pytest else []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
try:
 | 
					try:
 | 
				
			||||||
    setup(name=NAME,
 | 
					    setup(name=NAME,
 | 
				
			||||||
          version=PILLOW_VERSION,
 | 
					          version=PILLOW_VERSION,
 | 
				
			||||||
| 
						 | 
					@ -782,7 +785,8 @@ try:
 | 
				
			||||||
          ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
 | 
					          ext_modules=[Extension("PIL._imaging", ["_imaging.c"])],
 | 
				
			||||||
          include_package_data=True,
 | 
					          include_package_data=True,
 | 
				
			||||||
          packages=find_packages(),
 | 
					          packages=find_packages(),
 | 
				
			||||||
          test_suite='nose.collector',
 | 
					          setup_requires=pytest_runner,
 | 
				
			||||||
 | 
					          tests_require=['pytest'],
 | 
				
			||||||
          keywords=["Imaging", ],
 | 
					          keywords=["Imaging", ],
 | 
				
			||||||
          license='Standard PIL License',
 | 
					          license='Standard PIL License',
 | 
				
			||||||
          zip_safe=not (debug_build() or PLATFORM_MINGW), )
 | 
					          zip_safe=not (debug_build() or PLATFORM_MINGW), )
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -7,5 +7,5 @@ pacman -S --noconfirm mingw32/mingw-w64-i686-python3 \
 | 
				
			||||||
	   mingw32/mingw-w64-i686-python2-setuptools \
 | 
						   mingw32/mingw-w64-i686-python2-setuptools \
 | 
				
			||||||
	   mingw-w64-i686-libjpeg-turbo
 | 
						   mingw-w64-i686-libjpeg-turbo
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/mingw32/bin/pip install nose olefile
 | 
					/mingw32/bin/pip install pytest pytest-cov olefile
 | 
				
			||||||
/mingw32/bin/pip3 install nose olefile
 | 
					/mingw32/bin/pip3 install pytest pytest-cov olefile
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,7 +16,7 @@ def setup_vms():
 | 
				
			||||||
        for arch in ('', X64_EXT):
 | 
					        for arch in ('', X64_EXT):
 | 
				
			||||||
            ret.append("virtualenv -p c:/Python%s%s/python.exe --clear %s%s%s"
 | 
					            ret.append("virtualenv -p c:/Python%s%s/python.exe --clear %s%s%s"
 | 
				
			||||||
                       % (py, arch, VIRT_BASE, py, arch))
 | 
					                       % (py, arch, VIRT_BASE, py, arch))
 | 
				
			||||||
            ret.append(r"%s%s%s\Scripts\pip.exe install nose" %
 | 
					            ret.append(r"%s%s%s\Scripts\pip.exe install pytest pytest-cov" %
 | 
				
			||||||
                       (VIRT_BASE, py, arch))
 | 
					                       (VIRT_BASE, py, arch))
 | 
				
			||||||
    return "\n".join(ret)
 | 
					    return "\n".join(ret)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user