Skip to content

Commit 9451035

Browse files
committed
chore: suppress deprecation notices for test_all imports
Signed-off-by: Brian Harring <ferringb@gmail.com>
1 parent fe7372c commit 9451035

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/snakeoil/test/code_quality.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,13 +111,14 @@ def test_has__all__(self, subtests):
111111
assert hasattr(module, "__all__"), "__all__ is missing but should exist"
112112

113113
def test_valid__all__(self, subtests):
114-
for module in self.collect_modules():
115-
with subtests.test(module=module.__name__):
116-
if attrs := getattr(module, "__all__", ()):
117-
missing = {attr for attr in attrs if not hasattr(module, attr)}
118-
assert not missing, (
119-
f"__all__ refers to exports that don't exist: {missing!r}"
120-
)
114+
with deprecation.suppress_deprecations():
115+
for module in self.collect_modules():
116+
with subtests.test(module=module.__name__):
117+
if attrs := getattr(module, "__all__", ()):
118+
missing = {attr for attr in attrs if not hasattr(module, attr)}
119+
assert not missing, (
120+
f"__all__ refers to exports that don't exist: {missing!r}"
121+
)
121122

122123

123124
class ExpiredDeprecations(NamespaceCollector, still_abstract=True):

0 commit comments

Comments
 (0)