Skipping mutation test for file with local changes

This commit is contained in:
Sandeep Hegde 2017-11-06 12:57:00 -05:00
parent ffbabf4a4c
commit d24d6ac8ef

View file

@ -33,6 +33,10 @@ def mutate_random_line(file_name):
def mutation_test(file_name, tests):
local_changes_present = subprocess.call('git diff --quiet {0}'.format(file_name), shell=True)
if local_changes_present == 1:
print "{0} has local changes, please commit/remove changes before running the test".format(file_name)
else:
mutated_line = mutate_random_line(file_name)
if mutated_line != -1:
print "Mutating {0} at line {1}".format(file_name, mutated_line)