Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion mutmut/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import signal
import subprocess
import sys
import platform
from abc import ABC
from collections import defaultdict
from configparser import (
Expand Down Expand Up @@ -55,7 +56,11 @@
import libcst as cst
import libcst.matchers as m
from rich.text import Text
from setproctitle import setproctitle

# do not import on macOS before forking, because this causes a segfault on newer versions (see #446)
# on other platforms, import before forking for a small performance gain (import takes some miliseconds; re-import later on is instant)
if platform.system() != 'Darwin':
from setproctitle import setproctitle

import mutmut
from mutmut.code_coverage import gather_coverage, get_covered_lines_for_file
Expand Down Expand Up @@ -1101,6 +1106,8 @@ def read_one_child_exit_status():
if not pid:
# In the child
os.environ['MUTANT_UNDER_TEST'] = mutant_name
# import for macOS (on other platforms, this re-import does nothing)
from setproctitle import setproctitle
setproctitle(f'mutmut: {mutant_name}')

# Run fast tests first
Expand Down