From ca48f461b2dcac2970829e4e021316654c308d90 Mon Sep 17 00:00:00 2001 From: Mike Bayer Date: Tue, 25 Jan 2022 00:45:30 -0500 Subject: replace test tags with pytest.mark replaced the __tags__ class attribute and the --exclude-tags / --include-tags test runner options with regular pytest.mark names so that we can take advantage of mark expressions. options --nomemory, --notimingintensive, --backend-only, --exclude-tags, --include-tags remain as legacy but make use of pytest mark for implemementation. Added a "mypy" mark for the section of tests that are doing mypy integration tests. The __backend__ and __sparse_backend__ class attributes also use pytest marks for their implementation, which also allows the marks "backend" and "sparse_backend" to be used explicitly. Also removed the no longer used "--cdecimal" option as this was python 2 specific. in theory, the usage of pytest marks could expand such that the whole exclusions system would be based on it, but this does not seem to have any advantage at the moment. Change-Id: Ideeb57d9d49f0efc7fc0b6b923b31207ab783025 --- lib/sqlalchemy/testing/exclusions.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) (limited to 'lib/sqlalchemy/testing/exclusions.py') diff --git a/lib/sqlalchemy/testing/exclusions.py b/lib/sqlalchemy/testing/exclusions.py index b92d6859f..b51f6e57c 100644 --- a/lib/sqlalchemy/testing/exclusions.py +++ b/lib/sqlalchemy/testing/exclusions.py @@ -35,7 +35,6 @@ class compound: def __init__(self): self.fails = set() self.skips = set() - self.tags = set() def __add__(self, other): return self.add(other) @@ -44,25 +43,22 @@ class compound: rule = compound() rule.skips.update(self.skips) rule.skips.update(self.fails) - rule.tags.update(self.tags) return rule def add(self, *others): copy = compound() copy.fails.update(self.fails) copy.skips.update(self.skips) - copy.tags.update(self.tags) + for other in others: copy.fails.update(other.fails) copy.skips.update(other.skips) - copy.tags.update(other.tags) return copy def not_(self): copy = compound() copy.fails.update(NotPredicate(fail) for fail in self.fails) copy.skips.update(NotPredicate(skip) for skip in self.skips) - copy.tags.update(self.tags) return copy @property @@ -83,16 +79,9 @@ class compound: if predicate(config) ] - def include_test(self, include_tags, exclude_tags): - return bool( - not self.tags.intersection(exclude_tags) - and (not include_tags or self.tags.intersection(include_tags)) - ) - def _extend(self, other): self.skips.update(other.skips) self.fails.update(other.fails) - self.tags.update(other.tags) def __call__(self, fn): if hasattr(fn, "_sa_exclusion_extend"): @@ -166,16 +155,6 @@ class compound: ) -def requires_tag(tagname): - return tags([tagname]) - - -def tags(tagnames): - comp = compound() - comp.tags.update(tagnames) - return comp - - def only_if(predicate, reason=None): predicate = _as_predicate(predicate) return skip_if(NotPredicate(predicate), reason) -- cgit v1.2.1