Skip to content

Commit caff459

Browse files
Fix wonkiness when mutant_names tuple includes at least one space
Second step, _fix_ the wonkiness and _verify_ the fix.
1 parent 4bcf3bc commit caff459

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

mutmut/__main__.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -962,10 +962,13 @@ def _run(mutant_names: Union[tuple, list], max_children: Union[None, int]):
962962
# TODO: we should be able to get information on which tests killed mutants, which means we can get a list of tests and how many mutants each test kills. Those that kill zero mutants are redundant!
963963
os.environ['MUTANT_UNDER_TEST'] = 'mutant_generation'
964964
ensure_config_loaded()
965-
if isinstance(mutant_names, tuple) and 1 == len(mutant_names):
966-
bits = mutant_names[0].split(' ')
967-
if 1 < len(bits):
968-
mutant_names = bits
965+
if isinstance(mutant_names, tuple):
966+
bits = []
967+
for item in mutant_names:
968+
bits.extend(item.split(' '))
969+
970+
if len(bits) > len(mutant_names):
971+
mutant_names = tuple(bits)
969972

970973
if max_children is None:
971974
max_children = os.cpu_count() or 4

0 commit comments

Comments
 (0)