From a49b744e951a810040baca27ff04fda23f973e26 Mon Sep 17 00:00:00 2001 From: Simon Conseil Date: Thu, 26 Sep 2013 00:37:35 +0200 Subject: [PATCH] Fix tests with latest versions of smartypants. smartypants is now py3 compatible but the default settings for double quotes has been changed (http://pythonhosted.org/smartypants/changes.html). This commit: - update the typogrify test (change quotes, and add more test casesi: caps word, ellipsis) - install typogrify on travis - uses upstream version of smartypants in tox instead of dmdm's fork for py3 --- .travis.yml | 2 ++ pelican/tests/content/article.rst | 2 +- pelican/tests/test_readers.py | 13 +++++++------ tox.ini | 1 - 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/.travis.yml b/.travis.yml index 1df32baa..62373e68 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ before_install: - sudo locale-gen fr_FR.UTF-8 tr_TR.UTF-8 install: - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi + - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install typogrify ; fi + - if [[ $TRAVIS_PYTHON_VERSION == '3.3' ]]; then pip install git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify; fi - pip install mock nose nose-cov Markdown - pip install . script: nosetests -sv --with-coverage --cover-package=pelican pelican diff --git a/pelican/tests/content/article.rst b/pelican/tests/content/article.rst index 7109c29b..793e6869 100644 --- a/pelican/tests/content/article.rst +++ b/pelican/tests/content/article.rst @@ -1,6 +1,6 @@ Article title ############# -This is some content. With some stuff to "typogrify". +THIS is some content. With some stuff to "typogrify"... Now with added support for :abbr:`TLA (three letter acronym)`. diff --git a/pelican/tests/test_readers.py b/pelican/tests/test_readers.py index b6652d03..841e3d34 100644 --- a/pelican/tests/test_readers.py +++ b/pelican/tests/test_readers.py @@ -104,8 +104,8 @@ class RstReaderTest(ReaderTest): # if nothing is specified in the settings, the content should be # unmodified page = self.read_file(path='article.rst') - expected = ('

This is some content. With some stuff to ' - '"typogrify".

\n

Now with added ' + expected = ('

THIS is some content. With some stuff to ' + '"typogrify"...

\n

Now with added ' 'support for ' 'TLA.

\n') @@ -114,10 +114,11 @@ class RstReaderTest(ReaderTest): try: # otherwise, typogrify should be applied page = self.read_file(path='article.rst', TYPOGRIFY=True) - expected = ('

This is some content. With some stuff to ' - '“typogrify”.

\n

Now with added ' - 'support for ' - 'TLA.

\n') + expected = ( + '

THIS is some content. ' + 'With some stuff to "typogrify"…

\n' + '

Now with added support for TLA.

\n') self.assertEqual(page.content, expected) except ImportError: diff --git a/tox.ini b/tox.ini index 8763c963..440216cf 100644 --- a/tox.ini +++ b/tox.ini @@ -22,6 +22,5 @@ deps = mock Markdown BeautifulSoup4 - git+https://github.com/dmdm/smartypants.git#egg=smartypants git+https://github.com/dmdm/typogrify.git@py3k#egg=typogrify lxml