(self, test, err)
| 223 | """.format(test, subtest, pickle_exc)) |
| 224 | |
| 225 | def check_picklable(self, test, err): |
| 226 | # Ensure that sys.exc_info() tuples are picklable. This displays a |
| 227 | # clear multiprocessing.pool.RemoteTraceback generated in the child |
| 228 | # process instead of a multiprocessing.pool.MaybeEncodingError, making |
| 229 | # the root cause easier to figure out for users who aren't familiar |
| 230 | # with the multiprocessing module. Since we're in a forked process, |
| 231 | # our best chance to communicate with them is to print to stdout. |
| 232 | try: |
| 233 | self._confirm_picklable(err) |
| 234 | except Exception as exc: |
| 235 | original_exc_txt = repr(err[1]) |
| 236 | original_exc_txt = textwrap.fill( |
| 237 | original_exc_txt, 75, initial_indent=" ", subsequent_indent=" " |
| 238 | ) |
| 239 | pickle_exc_txt = repr(exc) |
| 240 | pickle_exc_txt = textwrap.fill( |
| 241 | pickle_exc_txt, 75, initial_indent=" ", subsequent_indent=" " |
| 242 | ) |
| 243 | if tblib is None: |
| 244 | print(""" |
| 245 | |
| 246 | {} failed: |
| 247 | |
| 248 | {} |
| 249 | |
| 250 | Unfortunately, tracebacks cannot be pickled, making it impossible for the |
| 251 | parallel test runner to handle this exception cleanly. |
| 252 | |
| 253 | In order to see the traceback, you should install tblib: |
| 254 | |
| 255 | python -m pip install tblib |
| 256 | """.format(test, original_exc_txt)) |
| 257 | else: |
| 258 | print(""" |
| 259 | |
| 260 | {} failed: |
| 261 | |
| 262 | {} |
| 263 | |
| 264 | Unfortunately, the exception it raised cannot be pickled, making it impossible |
| 265 | for the parallel test runner to handle it cleanly. |
| 266 | |
| 267 | Here's the error encountered while trying to pickle the exception: |
| 268 | |
| 269 | {} |
| 270 | |
| 271 | You should re-run this test with the --parallel=1 option to reproduce the |
| 272 | failure and get a correct traceback. |
| 273 | """.format(test, original_exc_txt, pickle_exc_txt)) |
| 274 | raise |
| 275 | |
| 276 | def check_subtest_picklable(self, test, subtest): |
| 277 | try: |
no test coverage detected