Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(929)

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py

Issue 2872593004: webkitpy: Fix removing expectation lines. (Closed)
Patch Set: git cl try Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
index 567c80eafe9131e4d9fc366758b9fbb3df91c1eb..e43b247c7c90dcc20bacda7be61e7896c3d6e601 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py
@@ -250,7 +250,8 @@ class TestExpectationLine(object):
self.name, self.matching_configurations, self.original_string)
def __eq__(self, other):
- return (self.original_string == other.original_string
+ return (isinstance(other, self.__class__)
+ and self.original_string == other.original_string
and self.filename == other.filename
and self.line_numbers == other.line_numbers
and self.name == other.name
@@ -695,7 +696,7 @@ class TestExpectationsModel(object):
raise ValueError(expectation)
def remove_expectation_line(self, test):
- if not self.has_test(test):
+ if not self.has_test(test.name):
return
self._clear_expectations_for_test(test)
del self._test_to_expectation_line[test]
@@ -1180,10 +1181,17 @@ class TestExpectations(object):
model.add_expectation_line(expectation_line)
self._model.merge_model(model)
- def remove_tests(self, tests_to_remove):
+ def remove_tests_from_expectations(self, tests_to_remove):
for test in self._expectations:
- if test.name and test.name in tests_to_remove:
- self.remove_expectation_line(test)
+ if not test.name:
+ continue
+ if test.name not in tests_to_remove:
+ continue
+ self._expectations.remove(test)
+ if not self._model.has_test(test.name):
+ continue
+ line = self._model.get_expectation_line(test.name)
+ self._model.remove_expectation_line(line)
def add_expectations_from_bot(self):
# FIXME: With mode 'very-flaky' and 'maybe-flaky', this will show the expectations entry in the flakiness
@@ -1201,12 +1209,6 @@ class TestExpectations(object):
self._model.add_expectation_line(expectation_line)
self._expectations += [expectation_line]
- def remove_expectation_line(self, test):
- if not self._model.has_test(test):
- return
- self._expectations.remove(self._model.get_expectation_line(test))
- self._model.remove_expectation_line(test)
-
@staticmethod
def list_to_string(expectation_lines, test_configuration_converter=None, reconstitute_only_these=None):
def serialize(expectation_line):
« no previous file with comments | « third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/controllers/manager.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698