merge with main

This commit is contained in:
Georg Brandl
2009-01-03 12:35:15 +01:00
69 changed files with 398 additions and 248 deletions

View File

@@ -6,7 +6,7 @@
This script runs the Sphinx unit test suite.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the Sphinx class.
:copyright: 2008 by Benjamin Peterson.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -6,7 +6,7 @@
Test the autodoc extension. This tests mainly the RstGenerator; the auto
directives are tested in a test source file translated by test_build.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the entire build process with the test root.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -6,7 +6,7 @@
Test the sphinx.config.Config class and its handling in the
Application class.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the coverage builder.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the BuildEnvironment class.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the Pygments highlighting bridge.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
@@ -28,6 +28,11 @@ class MyLexer(RegexLexer):
],
}
class ComplainOnUnhighlighted(PygmentsBridge):
def unhighlighted(self, source):
raise AssertionError("should highlight %r" % source)
class MyFormatter(HtmlFormatter):
def format(self, tokensource, outfile):
outfile.write('test')
@@ -41,6 +46,18 @@ def test_add_lexer(app):
ret = bridge.highlight_block('ab', 'test')
assert '<span class="n">a</span>b' in ret
def test_detect_interactive():
bridge = ComplainOnUnhighlighted('html')
blocks = [
"""
>>> testing()
True
""",
]
for block in blocks:
ret = bridge.highlight_block(block.lstrip(), 'python')
assert ret.startswith("<div class=\"highlight\">")
def test_set_formatter():
PygmentsBridge.html_formatter = MyFormatter
try:

View File

@@ -5,7 +5,7 @@
Test locale features.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test various Sphinx-specific markup extensions.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -5,7 +5,7 @@
Test the sphinx.quickstart module.
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""

View File

@@ -3,7 +3,7 @@
Sphinx test suite utilities
~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: 2008 by Georg Brandl.
:copyright: Copyright 2007-2009 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""