Skip to content

Commit ab14b58

Browse files
committed
Fix: write only new called lines into log (#25)
1 parent 7551b94 commit ab14b58

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
setuptools.setup(
77
name="simple_coverage",
8-
version="0.3.0",
8+
version="0.3.1",
99
author="Nikolai Limbrunner",
1010
author_email="[email protected]",
1111
description="Simple Coverage measurements for Python",

simple_coverage/output.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ def save_coverage_output(func_name, instructions_dict, called_instructions):
3030

3131
# check if function already exists
3232
if func_name in data:
33-
# append called instructions to existing function
34-
data[func_name]["called_instructions"].extend(called_instructions)
33+
# append new called instructions to existing function
34+
for instruction in called_instructions:
35+
if instruction not in data[func_name]["called_instructions"]:
36+
data[func_name]["called_instructions"].append(instruction)
3537
else:
3638
# otherwise create new entry for new function
3739
data.update(

0 commit comments

Comments
 (0)