From a7a71da6df64de5b1ce7f92d133a68f14d6ba8f8 Mon Sep 17 00:00:00 2001 From: Simon Date: Thu, 21 Feb 2013 15:57:25 +0100 Subject: [PATCH] Fix a test in the asciidoc reader, and add asciidoc to travis so that the related tests will not be skipped. --- .travis.yml | 3 ++- pelican/readers.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 8b292101..569ea7b6 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,8 +4,9 @@ python: - "3.2" before_install: - sudo apt-get update -qq - - sudo apt-get install -qq ruby-sass + - sudo apt-get install -qq --no-install-recommends asciidoc ruby-sass install: + - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then ln -s /usr/share/asciidoc/asciidocapi.py ~/virtualenv/python2.7/lib/python2.7/site-packages/; fi - pip install nose mock --use-mirrors - if [[ $TRAVIS_PYTHON_VERSION == '2.7' ]]; then pip install --use-mirrors unittest2; else pip install --use-mirrors unittest2py3k; fi - pip install . --use-mirrors diff --git a/pelican/readers.py b/pelican/readers.py index 99dc6e54..1623fb7f 100644 --- a/pelican/readers.py +++ b/pelican/readers.py @@ -285,7 +285,8 @@ class AsciiDocReader(Reader): def read(self, source_path): """Parse content and metadata of asciidoc files""" from cStringIO import StringIO - text = StringIO(pelican_open(source_path)) + with pelican_open(source_path) as source: + text = StringIO(source) content = StringIO() ad = AsciiDocAPI()