diff --git a/setup.py b/setup.py index 52aaec9..afdcf6f 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ setuptools.setup( name="simple_coverage", - version="0.3.0", + version="0.3.1", author="Nikolai Limbrunner", author_email="nikolai.limbrunner@gmail.com", description="Simple Coverage measurements for Python", diff --git a/simple_coverage/output.py b/simple_coverage/output.py index 00bbc60..e365951 100644 --- a/simple_coverage/output.py +++ b/simple_coverage/output.py @@ -30,8 +30,10 @@ def save_coverage_output(func_name, instructions_dict, called_instructions): # check if function already exists if func_name in data: - # append called instructions to existing function - data[func_name]["called_instructions"].extend(called_instructions) + # append new called instructions to existing function + for instruction in called_instructions: + if instruction not in data[func_name]["called_instructions"]: + data[func_name]["called_instructions"].append(instruction) else: # otherwise create new entry for new function data.update(