Skip to content

Commit

Permalink
Merge pull request #41 from zopefoundation/FakeInputContinueGenerator…
Browse files Browse the repository at this point in the history
…-close

Fixed: Using the -j option to run tests in multiple processes
  • Loading branch information
jimfulton committed Jun 21, 2016
2 parents 44b7b53 + c45b3dc commit 76e22fa
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGES.rst
Expand Up @@ -4,7 +4,10 @@ zope.testrunner Changelog
4.5.1 (unreleased)
==================

- Nothing changed yet.
- Fixed: Using the ``-j`` option to run tests in multiple processes
caused tests that used the ``multiprocessing`` package to hang
(because the testrunner replaced ``sys.stdin`` with an unclosable
object).


4.5.0 (2016-05-02)
Expand Down
3 changes: 3 additions & 0 deletions src/zope/testrunner/runner.py
Expand Up @@ -959,3 +959,6 @@ def readline(self):
print('*'*70)
print()
return 'c\n'

def close(self):
pass
9 changes: 9 additions & 0 deletions src/zope/testrunner/tests/test_runner.py
Expand Up @@ -171,3 +171,12 @@ class ZZ(K1, K2, K3): pass
# Sorting by reverse MRO, as computed by Python's MRO algorithm,
# would put the layers in a different order: K3, K1, K2, ZZ.
# Does that matter? The class diagram is symmetric, so I think not.

def test_FakeInputContinueGenerator_close(self):
# multiprocessing (and likely other forkful frameworks want to
# close sys.stdin. The test runner replaces sys.stdin with a
# FakeInputContinueGenerator for some reason. It should be
# closeable.

f = runner.FakeInputContinueGenerator()
f.close()

0 comments on commit 76e22fa

Please sign in to comment.