[TIP] Coverage threading bug?

Ned Batchelder ned at nedbatchelder.com
Thu Apr 23 18:36:30 PDT 2015


Michael, it would be great if you could file this as a bug at 
https://bitbucket.org/ned/coveragepy/issues/new

Please include the version of coverage you were using.

Thanks,

--Ned.

On 4/23/15 5:47 PM, Michael McNeil Forbes wrote:
> When I try to cover the following program, it ends up hanging and the thread is never executed (hence the even is never set).  Any suggestions?
>
>
> """Bug with coverage - try running with
>
> coverage run -m threading_bug.py
>
> or
>
> nosetests --with-coverage --cover-package=threading_bug threading_bug.py
>
> """
> import threading
>
> initialised = threading.Event()
> initialised.clear()
>
> def run():
>      initialised.set()
>
>
> t = threading.Thread(target=run)
> t.daemon = True
> t.start()
>
> while not initialised.is_set():
>      pass
>
> t.join()
>
> ----------------
>
> Let me know if I should submit this as a bug.
>
> I found this covering code that did the following:
>
> import pyfftw
> pyfftw.interfaces.cache.enable()
> _______________________________________________
> testing-in-python mailing list
> testing-in-python at lists.idyll.org
> http://lists.idyll.org/listinfo/testing-in-python




More information about the testing-in-python mailing list