Skip to content

Commit

Permalink
(#28) Ensure coverage cover sub-processes (#63)
Browse files Browse the repository at this point in the history
Ensure sigterm is handled by coverage. This way, coverage can collect data before process termination

Issue was coverage does not handle sigterm by default, so it couldn't get to collect data upon termination: nedbat/coveragepy#1307 (comment)

Need to explicitly tell coverage to handle sigterm: https://coverage.readthedocs.io/en/latest/changes.html#version-6-4-2022-05-22

Signed-off-by: Imran Ariffin <ariffin.imran@gmail.com>
  • Loading branch information
imranariffin authored Jul 22, 2023
1 parent 1a6a05c commit 10f264e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@
source = src/
parallel = True
concurrency = multiprocessing
sigterm = True
2 changes: 1 addition & 1 deletion src/aiotaskq/worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from .interfaces import ConcurrencyType, IConcurrencyManager, IPubSub
from .pubsub import PubSub

if t.TYPE_CHECKING:
if t.TYPE_CHECKING: # pragma: no cover
from .task import Task

logging.basicConfig(level=logging.INFO)
Expand Down

0 comments on commit 10f264e

Please sign in to comment.