﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
29023	running tests in parallel doesn't show exception chain, even with tblib	Chris Jerdonek	nobody	"Running tests in parallel doesn't show more than the first link of an exception chain. For example, with the following test (with `tblib` installed):

{{{#!python
def test(self):
    time.sleep(2)
    try:
        raise ValueError('foo')
    except Exception:
        raise KeyError('bar')
}}}

this is what the failure looks like when running tests in parallel:

{{{
Traceback (most recent call last):
  File ""/Users/.../versions/3.6.4/lib/python3.6/unittest/case.py"", line 59, in testPartExecutor
    yield
  File ""/Users/.../versions/3.6.4/lib/python3.6/unittest/case.py"", line 605, in run
    testMethod()
  File ""/Users/.../myproject/myproject/tests/test_a.py"", line 13, in test2
    raise KeyError('bar')
KeyError: 'bar'
}}}

In contrast, this is what it looks like when running them not in parallel:

{{{
Traceback (most recent call last):
  File ""/Users/.../myproject/myproject/tests/test_a.py"", line 11, in test2
    raise ValueError('foo')
ValueError: foo

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File ""/Users/.../myproject/myproject/tests/test_a.py"", line 13, in test2
    raise KeyError('bar')
KeyError: 'bar'
}}}

Side question: why must pickling be used at all? Why can't we simply render the traceback to a string using Python's `traceback` module, and then send the string back? It seems like that would result in simpler, more understandable code and sidestep many of the difficulties.

(This was reported using Python 3.6.4. and `master` as of Jan. 15, 2018: 02365d3f38a64a5c2f3e932f23925a381d5bb151 .)
"	Cleanup/optimization	new	Testing framework	dev	Normal		parallel,exception,chain,traceback,pickling,tblib	Chris Jerdonek Sage Abdullah Ülgen Sarıkavak	Accepted	0	0	0	0	0	0
