summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorDylan Baker <dylan@pnwbakers.com>2016-10-14 16:19:26 -0700
committerDylan Baker <dylan@pnwbakers.com>2016-11-10 10:51:02 -0800
commitd3cf9064e44af40a306244669b45070f98808a2a (patch)
tree92f7870358c5cfaef8d1e7e6866f2e646d2f01f6 /framework
parente92555a647f50b0014198cc91defe0062a23383d (diff)
framework/profile: Factor out check_all closure
This does away with the check_all closure, by simplifying it down to an equivalent lambda expression. Signed-off-by: Dylan Baker <dylanx.c.baker@intel.com>
Diffstat (limited to 'framework')
-rw-r--r--framework/profile.py14
1 files changed, 3 insertions, 11 deletions
diff --git a/framework/profile.py b/framework/profile.py
index 17d17db37..a6843aebe 100644
--- a/framework/profile.py
+++ b/framework/profile.py
@@ -203,7 +203,7 @@ class TestDict(collections.MutableMapping):
"""
for k, v in list(six.iteritems(self)):
- if not callable((k, v)):
+ if not callable(k, v):
del self[k]
def reorder(self, order):
@@ -290,23 +290,15 @@ class TestProfile(object):
runs it's own filters plus the filters in the self.filters name
"""
- def check_all(item):
- """ Checks group and test name against all filters """
- path, test = item
- for f in self.filters:
- if not f(path, test):
- return False
- return True
-
if self.forced_test_list:
# Remove all tests not in the test list, then reorder the tests to
# match the testlist. This still allows additional filters to be
# run afterwards.
- self.test_list.filter(lambda i: i[0] in self.forced_test_list)
+ self.test_list.filter(lambda n, _: n in self.forced_test_list)
self.test_list.reorder(self.forced_test_list)
# Filter out unwanted tests
- self.test_list.filter(check_all)
+ self.test_list.filter(lambda n, t: all(f(n, t) for f in self.filters))
if not self.test_list:
raise exceptions.PiglitFatalError(