Test of README build to HTML is now done with 'rst2html' command via tox.

This commit is contained in:
Benoît Bryon 2014-02-25 00:43:09 +01:00
parent 1ea2790ba9
commit 546bdc2461

View file

@ -50,44 +50,3 @@ class VersionTestCase(unittest.TestCase):
'You may need to run ``make develop`` to update the '
'installed version in development environment.'
% (self.get_version(), file_version))
class ReadMeTestCase(unittest.TestCase):
"""Test suite around README file."""
def test_readme_build(self):
"""README builds to HTML without errors."""
# Run build.
import docutils.core
import docutils.io
source = open(os.path.join(project_dir, 'README.rst')).read()
writer_name = 'html'
import sys
from StringIO import StringIO
stderr_backup = sys.stderr
sys.stderr = StringIO()
output, pub = docutils.core.publish_programmatically(
source=source,
source_class=docutils.io.StringInput,
source_path=None,
destination_class=docutils.io.StringOutput,
destination=None,
destination_path=None,
reader=None,
reader_name='standalone',
parser=None,
parser_name='restructuredtext',
writer=None,
writer_name=writer_name,
settings=None,
settings_spec=None,
settings_overrides=None,
config_section=None,
enable_exit_status=False)
sys.stderr = stderr_backup
errors = pub._stderr.stream.getvalue()
# Check result.
self.assertFalse(errors, "Docutils reported errors while building "
"readme content from reStructuredText to "
"HTML. So PyPI would display the readme as "
"text instead of HTML. Errors are:\n%s"
% errors)