commit c16d30d0e6c9bfe1a961bf67ecad24e6b171c948
parent 0afa1d31ba7095183ba04844f1870c0545ae4138
Author: Andrew Halberstadt <ahal@mozilla.com>
Date: Thu, 2 Oct 2025 15:28:49 +0000
Bug 1986773 - [ci] Stop testing third party 'attrmatch' function, r=taskgraph-reviewers,jmaher
Differential Revision: https://phabricator.services.mozilla.com/D267066
Diffstat:
1 file changed, 0 insertions(+), 38 deletions(-)
diff --git a/taskcluster/gecko_taskgraph/test/test_util_attributes.py b/taskcluster/gecko_taskgraph/test/test_util_attributes.py
@@ -7,7 +7,6 @@ import unittest
import pytest
from mozunit import main
-from taskgraph.util.attributes import attrmatch
from gecko_taskgraph.util.attributes import (
match_run_on_projects,
@@ -15,43 +14,6 @@ from gecko_taskgraph.util.attributes import (
)
-class Attrmatch(unittest.TestCase):
- def test_trivial_match(self):
- """Given no conditions, anything matches"""
- self.assertTrue(attrmatch({}))
-
- def test_missing_attribute(self):
- """If a filtering attribute is not present, no match"""
- self.assertFalse(attrmatch({}, someattr=10))
-
- def test_literal_attribute(self):
- """Literal attributes must match exactly"""
- self.assertTrue(attrmatch({"att": 10}, att=10))
- self.assertFalse(attrmatch({"att": 10}, att=20))
-
- def test_set_attribute(self):
- """Set attributes require set membership"""
- self.assertTrue(attrmatch({"att": 10}, att={9, 10}))
- self.assertFalse(attrmatch({"att": 10}, att={19, 20}))
-
- def test_callable_attribute(self):
- """Callable attributes are called and any False causes the match to fail"""
- self.assertTrue(attrmatch({"att": 10}, att=lambda val: True))
- self.assertFalse(attrmatch({"att": 10}, att=lambda val: False))
-
- def even(val):
- return val % 2 == 0
-
- self.assertTrue(attrmatch({"att": 10}, att=even))
- self.assertFalse(attrmatch({"att": 11}, att=even))
-
- def test_all_matches_required(self):
- """If only one attribute does not match, the result is False"""
- self.assertFalse(attrmatch({"a": 1}, a=1, b=2, c=3))
- self.assertFalse(attrmatch({"a": 1, "b": 2}, a=1, b=2, c=3))
- self.assertTrue(attrmatch({"a": 1, "b": 2, "c": 3}, a=1, b=2, c=3))
-
-
class MatchRunOnProjects(unittest.TestCase):
def test_empty(self):
self.assertFalse(match_run_on_projects("birch", []))