Skip to content

Commit 69a5b7b

Browse files
committed
Fix paths_to_mutate for file paths
1 parent 7aa18b1 commit 69a5b7b

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

mutmut/__main__.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -176,8 +176,12 @@ class BadTestExecutionCommandsException(Exception):
176176

177177
def copy_src_dir():
178178
for path in mutmut.config.paths_to_mutate:
179-
output_path = Path('mutants') / path
180-
shutil.copytree(path, output_path, dirs_exist_ok=True)
179+
output_path: Path = Path('mutants') / path
180+
if isdir(path):
181+
shutil.copytree(path, output_path, dirs_exist_ok=True)
182+
else:
183+
output_path.parent.mkdir(exist_ok=True, parents=True)
184+
shutil.copyfile(path, output_path)
181185

182186
def create_mutants(max_children: int):
183187
with Pool(processes=max_children) as p:

0 commit comments

Comments
 (0)