Skip to content

Conversation

@xdegaye
Copy link
Contributor

@xdegaye xdegaye commented Nov 25, 2017


def test_get_event_loop_new_process(self):
# Skip the test if the sem_open() implementation is broken.
support.import_module('multiprocessing.synchronize')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The check is very non-obvious.
Don't how to make it more verbose and explicit.
If it's impossible -- I can live with it.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ProcessPoolExecutor uses the multiprocessing (mp) module. The mp module is not functional when the mp.synchronize module cannot be imported and all the mp tests are skipped in that case. So we use here the same idiom used to skip the mp tests (i.e. test.support.import_module('multiprocessing.synchronize')) to skip this test when the platform sem_open implementation is broken or missing.

What about replacing the comment with:

Issue bpo-32126: The multiprocessing module used by ProcessPoolExecutor
is not functional when the multiprocessing.synchronize module cannot be imported.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New comment text is perfect!

@xdegaye xdegaye merged commit a6fba9b into python:master Nov 26, 2017
@xdegaye xdegaye deleted the bpo-32126 branch November 26, 2017 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tests Tests in the Lib/test dir topic-asyncio

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants