1
1
mirror of https://github.com/Kozea/WeasyPrint.git synced 2024-09-11 12:46:15 +03:00

Support ./setup.py test, add tests for python 3.6

This commit is contained in:
Guillaume Ayoub 2017-03-24 23:18:50 +01:00
parent 210b73820d
commit 87097b7aed
6 changed files with 24 additions and 10 deletions

View File

@ -9,3 +9,4 @@ exclude_lines =
omit = omit =
weasyprint/tests/test_web/* weasyprint/tests/test_web/*
weasyprint/tests/w3_test_suite/* weasyprint/tests/w3_test_suite/*
.*

1
.gitignore vendored
View File

@ -3,6 +3,7 @@
# Building and Distributing # Building and Distributing
/*.egg-info /*.egg-info
/.eggs
/build /build
/dist /dist
/docs/_build /docs/_build

View File

@ -11,6 +11,8 @@ matrix:
python: 3.4 python: 3.4
- os: linux - os: linux
python: 3.5 python: 3.5
- os: linux
python: 3.6
- os: osx - os: osx
language: generic language: generic
env: PYTHON_VERSION=3 env: PYTHON_VERSION=3
@ -32,9 +34,7 @@ before_install:
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3 cairo pango gdk-pixbuf libxml2 libxslt libffi; fi - if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then brew install python3 cairo pango gdk-pixbuf libxml2 libxslt libffi; fi
install: install:
- pip$PYTHON_VERSION install --upgrade setuptools pytest flake8 - pip$PYTHON_VERSION install --upgrade -e.[test]
- pip$PYTHON_VERSION install -e .
script: script:
- python$PYTHON_VERSION -m pytest -s - python$PYTHON_VERSION setup.py test
- python$PYTHON_VERSION -m flake8 weasyprint

View File

@ -1,3 +0,0 @@
[pytest]
norecursedirs=.git .tox venv env
addopts=--tb=short

View File

@ -2,5 +2,9 @@
source-dir = docs source-dir = docs
build-dir = docs/_build build-dir = docs/_build
[flake8] [aliases]
exclude = docs,.git,.tox test = pytest
[tool:pytest]
addopts = --cov
norecursedirs = dist .cache .git build *.egg-info .eggs venv

13
setup.py Normal file → Executable file
View File

@ -1,4 +1,6 @@
#!/usr/bin/env python
# coding: utf-8 # coding: utf-8
""" """
WeasyPrint WeasyPrint
========== ==========
@ -41,6 +43,10 @@ if sys.version_info < (3,):
else: else:
REQUIREMENTS.append('CairoSVG >= 1.0.20') REQUIREMENTS.append('CairoSVG >= 1.0.20')
needs_pytest = {'pytest', 'test', 'ptr'}.intersection(sys.argv)
pytest_runner = ['pytest-runner'] if needs_pytest else []
setup( setup(
name='WeasyPrint', name='WeasyPrint',
version=VERSION, version=VERSION,
@ -60,6 +66,7 @@ setup(
'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Topic :: Internet :: WWW/HTTP', 'Topic :: Internet :: WWW/HTTP',
'Topic :: Text Processing :: Markup :: HTML', 'Topic :: Text Processing :: Markup :: HTML',
'Topic :: Multimedia :: Graphics :: Graphics Conversion', 'Topic :: Multimedia :: Graphics :: Graphics Conversion',
@ -67,12 +74,16 @@ setup(
], ],
packages=find_packages(), packages=find_packages(),
package_data={ package_data={
'weasyprint.hyphenation': ['*.dic'],
'weasyprint.tests': ['resources/*.*', 'resources/*/*'], 'weasyprint.tests': ['resources/*.*', 'resources/*/*'],
'weasyprint.css': ['*.css']}, 'weasyprint.css': ['*.css']},
zip_safe=False, zip_safe=False,
install_requires=REQUIREMENTS, install_requires=REQUIREMENTS,
setup_requires=pytest_runner,
test_suite='weasyprint.tests', test_suite='weasyprint.tests',
tests_require=[
"pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"],
extras_require={"test": [
"pytest-runner", "pytest-cov", "pytest-flake8", "pytest-isort"]},
entry_points={ entry_points={
'console_scripts': [ 'console_scripts': [
'weasyprint = weasyprint.__main__:main', 'weasyprint = weasyprint.__main__:main',