~cjwatson/lazr.restful/docutils-0.8-compat

Viewing all changes in revision 217.

  • Committer: Colin Watson
  • Date: 2018-02-21 14:46:13 UTC
  • Revision ID: cjwatson@canonical.com-20180221144613-7wjj7b3w908056dm
Fix compatibility with docutils >= 0.8 under "zope.testrunner --subunit".

When zope.testrunner is asked for subunit output, it replaces sys.stdout
with a StringIO.  Following
http://repo.or.cz/docutils.git/commitdiff/14cde9fb, this confuses docutils
into autoclosing the stdout stream in use by subunit, which broke the
Launchpad test suite following an upgrade to docutils 0.14.

_PydocParser uses epydoc.markup.restructuredtext._DocumentPseudoWriter,
which never writes any output, so the simplest fix for this is just to tell
docutils.core.Publisher to use docutils.io.NullOutput for its output, which
removes any risk of it going anywhere near stdout.

expand all expand all

Show diffs side-by-side

added added

removed removed

Lines of Context: