[Checkins] [zopefoundation/zope.testrunner] 777fbc: Refactor subprocess result output to emit bytes

GitHub noreply at github.com
Mon Jan 8 13:54:29 CET 2018


  Branch: refs/heads/master
  Home:   https://github.com/zopefoundation/zope.testrunner
  Commit: 777fbccf2954d739b634bec737a8f6eefdc6ae11
      https://github.com/zopefoundation/zope.testrunner/commit/777fbccf2954d739b634bec737a8f6eefdc6ae11
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2017-12-31 (Sun, 31 Dec 2017)

  Changed paths:
    M src/zope/testrunner/runner.py
    M src/zope/testrunner/tests/test_doctest.py
    M src/zope/testrunner/tests/testrunner-layers-buff.rst

  Log Message:
  -----------
  Refactor subprocess result output to emit bytes

This fixes the underlying problems that led to test failures on Python 3
in #23, paving the way for the reintroduction of subunit support.  It
also generally makes more logical sense to emit bytes here, as can be
seen from the way that we no longer need to decode in the Python 3 case
only to have the stream encode again.

Doctests still need to work with text, but we can handle that by
monkey-patching a replacement for `doctest._SpoofOut` on Python 3 that
makes an underlying `io.BytesIO` available.  (This effectively takes the
run-time special cases for Python 3 and isolates them in the doctest
support code, which seems like an improvement.)

`_get_output_buffer` is a simplified version of `subunit._unwrap_text`,
incorporated here to allow consistent behaviour without a hard
dependency on subunit.


  Commit: cf87a1b79eb7c115268c772918cd5cfab55e5a93
      https://github.com/zopefoundation/zope.testrunner/commit/cf87a1b79eb7c115268c772918cd5cfab55e5a93
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2018-01-01 (Mon, 01 Jan 2018)

  Changed paths:
    M src/zope/testrunner/tests/test_doctest.py

  Log Message:
  -----------
  Translate line separators for doctests


  Commit: 7fd95191e73c4d3cccb66e48a66d574f1e44ed03
      https://github.com/zopefoundation/zope.testrunner/commit/7fd95191e73c4d3cccb66e48a66d574f1e44ed03
  Author: Colin Watson <cjwatson at debian.org>
  Date:   2018-01-08 (Mon, 08 Jan 2018)

  Changed paths:
    M src/zope/testrunner/tests/test_doctest.py

  Log Message:
  -----------
  Translate line separators for doctests correctly


  Commit: 51736c187898b8cf202189772b3cb351969b495b
      https://github.com/zopefoundation/zope.testrunner/commit/51736c187898b8cf202189772b3cb351969b495b
  Author: Colin Watson <cjwatson at ubuntu.com>
  Date:   2018-01-08 (Mon, 08 Jan 2018)

  Changed paths:
    M src/zope/testrunner/runner.py
    M src/zope/testrunner/tests/test_doctest.py
    M src/zope/testrunner/tests/testrunner-layers-buff.rst

  Log Message:
  -----------
  Merge pull request #69 from cjwatson/refactor-runner-output

Refactor subprocess result output to emit bytes


Compare: https://github.com/zopefoundation/zope.testrunner/compare/a2899c4197b6...51736c187898


More information about the checkins mailing list