Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removed assumptions when mutant is killed #240

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions mutmut/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,17 +442,10 @@ def get_cached_mutation_statuses(filename, mutations, hash_of_tests):
mutant = get_or_create(Mutant, line=line, index=mutation_id.index, defaults=dict(status=UNTESTED))

result[mutation_id] = mutant.status
if mutant.status == OK_KILLED:
# We assume that if a mutant was killed, a change to the test
# suite will mean it's still killed
result[mutation_id] = mutant.status
else:
if mutant.tested_against_hash != hash_of_tests or \
mutant.tested_against_hash == NO_TESTS_FOUND or \
hash_of_tests == NO_TESTS_FOUND:
result[mutation_id] = UNTESTED
else:
result[mutation_id] = mutant.status
if mutant.tested_against_hash != hash_of_tests or \
mutant.tested_against_hash == NO_TESTS_FOUND or \
hash_of_tests == NO_TESTS_FOUND:
result[mutation_id] = UNTESTED

return result

Expand All @@ -468,11 +461,6 @@ def cached_mutation_status(filename, mutation_id, hash_of_tests):
if mutant is None:
mutant = get_or_create(Mutant, line=line, index=mutation_id.index, defaults=dict(status=UNTESTED))

if mutant.status == OK_KILLED:
# We assume that if a mutant was killed, a change to the test
# suite will mean it's still killed
return OK_KILLED

if mutant.tested_against_hash != hash_of_tests or \
mutant.tested_against_hash == NO_TESTS_FOUND or \
hash_of_tests == NO_TESTS_FOUND:
Expand Down