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

Unified Diff: build/android/pylib/instrumentation/instrumentation_test_instance.py

Issue 2095013002: [Android] Fix feature annotation filtering for instrumentation tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance_test.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/android/pylib/instrumentation/instrumentation_test_instance.py
diff --git a/build/android/pylib/instrumentation/instrumentation_test_instance.py b/build/android/pylib/instrumentation/instrumentation_test_instance.py
index 1d63f6b9a72ee60cd2d733460cc5a39cb7020792..12fe4309f298615ab0bfbec3e25358609875ac48 100644
--- a/build/android/pylib/instrumentation/instrumentation_test_instance.py
+++ b/build/android/pylib/instrumentation/instrumentation_test_instance.py
@@ -588,10 +588,20 @@ class InstrumentationTestInstance(test_instance.TestInstance):
return not any_annotation_matches(self._excluded_annotations,
all_annotations)
- def any_annotation_matches(annotations, all_annotations):
+ def any_annotation_matches(filter_annotations, all_annotations):
return any(
- ak in all_annotations and (av is None or av == all_annotations[ak])
- for ak, av in annotations.iteritems())
+ ak in all_annotations
rnephew (Reviews Here) 2016/06/24 14:22:43 These variables could probably be a little more de
jbudorick 2016/06/24 14:24:56 In a comprehension, I'd strongly prefer keeping th
+ and annotation_value_matches(av, all_annotations[ak])
+ for ak, av in filter_annotations.iteritems())
+
+ def annotation_value_matches(filter_av, av):
+ if filter_av is None:
+ return True
+ elif isinstance(av, dict):
+ return filter_av in av['value']
+ elif isinstance(av, list):
+ return filter_av in av
+ return filter_av == av
filtered_classes = []
for c in tests:
« no previous file with comments | « no previous file | build/android/pylib/instrumentation/instrumentation_test_instance_test.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698