This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author jason.curtis
Recipients jason.curtis
Date 2017-01-10.19:22:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484076129.07.0.522749594718.issue29229@psf.upfronthosting.co.za>
In-reply-to
Content
When a sentinel object from unittest.mock.sentinel is passed through a multiprocessing.Pool.map, I expect it to still be comparable. 

As a user, I'd like to be able to write a unit test using sentinels on my unparallelized code, and then see that the test still passes after I parallelize the code using multiprocessing, so that I can make use of sentinels in regression testing.


Example:
```
from unittest import mock
import multiprocessing


def identity(x):
    return x

with multiprocessing.Pool() as pool:
    multiprocessed = list(pool.map(identity, [mock.sentinel.foo]))

assert identity(mock.sentinel.foo) == mock.sentinel.foo  # Passes
assert multiprocessed[0] == mock.sentinel.foo  # Fails
```
History
Date User Action Args
2017-01-10 19:22:09jason.curtissetrecipients: + jason.curtis
2017-01-10 19:22:09jason.curtissetmessageid: <1484076129.07.0.522749594718.issue29229@psf.upfronthosting.co.za>
2017-01-10 19:22:09jason.curtislinkissue29229 messages
2017-01-10 19:22:08jason.curtiscreate