[TIP] Fwd: Coverage for threads

Kyle Lahnakoski klahnakoski at mozilla.com
Tue May 7 14:07:29 PDT 2019




I am using the low level threading library:

    from thread import allocate_lock, get_ident, start_new_thread

When I create a new thread, do I run

    cov = coverage.Coverage()
    cov.start()

at the start of each thread, as per
https://coverage.readthedocs.io/en/latest/api.html ?

Which is much like I already do for profiling:

    cprofiler = CProfiler()
    cprofiler.__enter__()

Thank you




More information about the testing-in-python mailing list