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

Overall niceties.

This commit is contained in:
Simon Sapin 2012-07-29 18:39:16 +02:00
parent a34fd1a616
commit 41e14d6e14
4 changed files with 19 additions and 18 deletions

19
tox.ini
View File

@ -1,24 +1,27 @@
[tox]
envlist = py26,py27,py27-introspection,py31,py32
envlist = py26, py27-introspection, py27-pygtk, py31, py32
[testenv]
sitepackages=True
deps=pytest
commands=py.test []
commands=
py.test -s []
python -m weasyprint.tests.gobject
[testenv:py31]
deps=
pytest
hg+https://bitbucket.org/liZe/pystacia
[testenv:py27]
commands=
py.test []
python -m weasyprint.tests.gobject assert_pygtk
[testenv:py27-introspection]
basepython=python2.7
setenv=WEASYPRINT_USE_INTROSPECTION=1
commands=
py.test []
py.test -s []
python -m weasyprint.tests.gobject assert_introspection
[testenv:py27-pygtk]
basepython=python2.7
commands=
py.test -s []
python -m weasyprint.tests.gobject assert_pygtk

View File

@ -17,6 +17,13 @@ from weasyprint.text import USING_INTROSPECTION
if __name__ == '__main__':
if '-h' in sys.argv or '--help' in sys.argv:
print('Usage:')
print(' python -m weasyprint.tests.gobject assert_introspection')
print(' python -m weasyprint.tests.gobject assert_pygtk')
print('The exit code is accordingly.')
print('')
if USING_INTROSPECTION:
print('Using PyGObject introspection.')
else:
@ -26,10 +33,3 @@ if __name__ == '__main__':
sys.exit(0 if USING_INTROSPECTION else 1)
elif 'assert_pygtk' in sys.argv:
sys.exit(1 if USING_INTROSPECTION else 0)
else:
print('')
print('Usage:')
print(' python -m weasyprint.tests.gobject assert_introspection')
print(' python -m weasyprint.tests.gobject assert_pygtk')
print('The exit code is set accordingly.')
sys.exit(1)

View File

@ -92,8 +92,6 @@ def test_bookmarks():
<h1>e</h1> #
''', structure_only=True)
assert root == dict(Count=5, First=1, Last=5)
import pprint
pprint.pprint(bookmarks, width=150)
assert bookmarks == [
dict(Count=3, First=2, Last=4, Next=5, Parent=0, Prev=None),
dict(Count=0, First=None, Last=None, Next=3, Parent=1, Prev=None),

View File

@ -34,7 +34,7 @@ if USING_INTROSPECTION:
if Pango.version() < 12903:
LOGGER.warn('Using Pango-introspection %s. Versions before '
'1.29.3 are known to be buggy.' % Pango.version_string())
'1.29.3 are known to be buggy.', Pango.version_string())
PANGO_VARIANT = {
'normal': Pango.Variant.NORMAL,