()
| 120 | |
| 121 | |
| 122 | def test_multiprocessing_identity_preserved(): |
| 123 | # type: () -> None |
| 124 | |
| 125 | # N.B.: Multiprocessing uses pickle; so this test is redundant to the test above, but it is more |
| 126 | # on point since we directly use multiprocessing and no-where use pickle. |
| 127 | |
| 128 | pool = multiprocessing.Pool() |
| 129 | try: |
| 130 | for input_, output in zip(Color.values(), pool.map(_identity, Color.values())): |
| 131 | assert input_ is output |
| 132 | finally: |
| 133 | pool.close() |
| 134 | pool.join() |