File tree Expand file tree Collapse file tree 3 files changed +9
-22
lines changed
Expand file tree Collapse file tree 3 files changed +9
-22
lines changed Original file line number Diff line number Diff line change @@ -311,7 +311,7 @@ omit = [
311311parallel = true
312312plugins = []
313313relative_files = true
314- source = [" trio" ]
314+ source = [" trio" , " tests/ " , " _trio_check_attrs_aliases " ]
315315
316316[tool .coverage .report ]
317317precision = 1
Original file line number Diff line number Diff line change @@ -220,23 +220,8 @@ def foo() -> None:
220220 if child_pid != 0 :
221221 # if this test fails, this will hang, triggering a timeout.
222222 os .waitpid (child_pid , 0 )
223- else :
224- # this is necessary because os._exit doesn't unwind the stack,
225- # so coverage doesn't get to automatically stop and save
226- # coverage information.
227- try :
228- import coverage
229-
230- cov = coverage .Coverage .current ()
231- # the following pragmas are necessary because if coverage:
232- # - isn't running, then it can't record the branch not
233- # taken
234- # - isn't installed, then it can't record the ImportError
235-
236- if cov : # pragma: no branch
237- cov .stop ()
238- cov .save ()
239- except ImportError : # pragma: no cover
240- pass
241-
242- os ._exit (0 ) # pragma: no cover # coverage was stopped above.
223+ else : # pragma: no cover # coverage is shut down by os._exit(0)
224+ # we would *want* to allow coverage to take a snapshot here. check
225+ # git blame for how to do that. however, that times out for some
226+ # reason when having `tests/` in `source` for coverage.py.
227+ os ._exit (0 )
Original file line number Diff line number Diff line change @@ -303,7 +303,9 @@ def start_thread_soon(
303303 THREAD_CACHE .start_thread_soon (fn , deliver , name )
304304
305305
306- def clear_worker_threads () -> None :
306+ def clear_worker_threads () -> (
307+ None
308+ ): # pragma: no cover # see test_clear_thread_cache_after_fork
307309 # This is OK because the child process does not actually have any
308310 # worker threads. Additionally, while WorkerThread keeps a strong
309311 # reference and so would get affected, the only place those are
You can’t perform that action at this time.
0 commit comments