[Twisted-Python] code coverage when code executed in a twisted worker thread

Chris Withers chris at withers.org
Mon Dec 3 01:04:13 MST 2018


On 01/12/2018 16:09, Kyle Altendorf wrote:
> 
> 
> On November 29, 2018 8:10:41 AM EST, Chris Withers <chris at withers.org> wrote:
>> I've noticed that code coverage doesn't appear to be recorded when code
>>
>> is executed in something that has been deferToThread'ed.
>>
>> Is this a known issue? Does anyone have an explanation?
> 
> Are you using coverage.py?  I don't know offhand but does Twisted use `thread` or `threading`?
> 
> https://coverage.readthedocs.io/en/coverage-4.2/trouble.html#things-that-don-t-work

You have to be using one of those to use threads in Python. Does Twisted 
use the older/lower level `thread` library?

Chris




More information about the Twisted-Python mailing list