diff --git a/.travis.yml b/.travis.yml index a8b001dc..b3cf983e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,6 @@ +sudo: false language: python -python: '2.7' +python: '3.5' env: - TOXENV=py26-integration - TOXENV=py26-min-req @@ -13,6 +14,9 @@ env: - TOXENV=py34-integration - TOXENV=py34-min-req - TOXENV=py34-unittests +- TOXENV=py35-integration +- TOXENV=py35-min-req +- TOXENV=py35-unittests - TOXENV=pypy-integration - TOXENV=pypy-min-req - TOXENV=pypy-unittests diff --git a/appveyor.yml b/appveyor.yml index 9263440c..cad24eef 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -10,6 +10,9 @@ environment: - TOXENV: py34-integration - TOXENV: py34-min-req - TOXENV: py34-unittests + - TOXENV: py35-integration + - TOXENV: py35-min-req + - TOXENV: py35-unittests - TOXENV: flake8 init: - "ECHO %TOXENV%" diff --git a/mkdocs/search.py b/mkdocs/search.py index f4006b51..10a92b8a 100644 --- a/mkdocs/search.py +++ b/mkdocs/search.py @@ -53,6 +53,7 @@ class SearchIndex(object): # us to iterate through it. parser = ContentParser() parser.feed(content) + parser.close() # Get the absolute URL for the page, this is then # prepended to the urls of the sections diff --git a/mkdocs/tests/search_tests.py b/mkdocs/tests/search_tests.py index f6343134..b4dbf911 100644 --- a/mkdocs/tests/search_tests.py +++ b/mkdocs/tests/search_tests.py @@ -28,6 +28,7 @@ class SearchTests(unittest.TestCase): parser = search.ContentParser() parser.feed('

Title

TEST') + parser.close() self.assertEquals(parser.data, [search.ContentSection( text=["TEST"], @@ -40,6 +41,7 @@ class SearchTests(unittest.TestCase): parser = search.ContentParser() parser.feed("

Title

TEST") + parser.close() self.assertEquals(parser.data, [search.ContentSection( text=["TEST"], @@ -52,6 +54,7 @@ class SearchTests(unittest.TestCase): parser = search.ContentParser() parser.feed("Content Before H1

Title

TEST") + parser.close() self.assertEquals(parser.data, [search.ContentSection( text=["TEST"], diff --git a/mkdocs/toc.py b/mkdocs/toc.py index c00dabee..b051201b 100644 --- a/mkdocs/toc.py +++ b/mkdocs/toc.py @@ -65,6 +65,13 @@ class TOCParser(HTMLParser): self.attrs = None self.title = '' + # Prior to Python3.4 no convert_charrefs keyword existed. + # However, in Python3.5 the default was changed to True. + # We need the False behavior in all versions but can only + # set it if it exists. + if hasattr(self, 'convert_charrefs'): + self.convert_charrefs = False + def handle_starttag(self, tag, attrs): if not self.in_anchor: diff --git a/tox.ini b/tox.ini index d0424765..d5377501 100644 --- a/tox.ini +++ b/tox.ini @@ -1,19 +1,20 @@ [tox] envlist = - py{26,27,33,34}-{unittests,integration,min-req}, + py{26,27,33,34,35}-{unittests,integration,min-req}, flake8 [testenv] passenv = LANG deps= - py{26,27,33,34,py,py3}-{unittests,integration}: -rrequirements/project.txt - py{26,27,33,34,py,py3}-min-req: -rrequirements/project-min.txt - py{26,27,33,34,py,py3}-{unittests,min-req}: -rrequirements/test.txt + py{26,27,33,34,35,py,py3}-{unittests,integration}: -rrequirements/project.txt + py{26,27,33,34,35,py,py3}-min-req: -rrequirements/project-min.txt + py{26,27,33,34,35,py,py3}-{unittests,min-req}: -rrequirements/test.txt commands= - py{26,27,33,34,py,py3}-{unittests,min-req}: {envbindir}/nosetests --with-coverage --cover-package mkdocs mkdocs - py{26,27,33,34,py,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds + py{26,27,33,34,35,py,py3}-{unittests,min-req}: {envbindir}/nosetests --with-coverage --cover-package mkdocs mkdocs + py{26,27,33,34,35,py,py3}-integration: {envpython} -m mkdocs.tests.integration --output={envtmpdir}/builds [testenv:flake8] +basepython = python2.7 deps=-rrequirements/test.txt commands={envbindir}/flake8 mkdocs --max-line-length=119 --exclude=mkdocs/compat.py