From c9fd1b1a17af94c234fc0521ebb0878f2e75569d Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 14 Jan 2011 15:12:02 +0100 Subject: [PATCH] Don't consider results as modified if they're empty. --- core/results.py | 2 +- core/tests/results_test.py | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/core/results.py b/core/results.py index a54e1802..33381da6 100644 --- a/core/results.py +++ b/core/results.py @@ -114,7 +114,7 @@ class Results(Markable): self.__group_of_duplicate[dupe] = g if not hasattr(dupe, 'is_ref'): dupe.is_ref = False - self.is_modified = True + self.is_modified = bool(self.__groups) old_filters = nonone(self.__filters, []) self.apply_filter(None) for filter_str in old_filters: diff --git a/core/tests/results_test.py b/core/tests/results_test.py index df5b3219..4fae5553 100644 --- a/core/tests/results_test.py +++ b/core/tests/results_test.py @@ -72,6 +72,11 @@ class TestCaseResultsEmpty: def test_is_modified(self): assert not self.results.is_modified + def test_is_modified_after_setting_empty_group(self): + # Don't consider results as modified if they're empty + self.results.groups = [] + assert not self.results.is_modified + class TestCaseResultsWithSomeGroups: def setup_method(self, method):