Skip to content

Commit 7a4f7eb

Browse files
committed
Fix zip calls
This omits strict=True, which is only supported in Python 3.10 and later, and instead explicitly asserts that the arguments are the same length (which is arguably better for its explicitness anyway).
1 parent 1f290f1 commit 7a4f7eb

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

test/deprecation/test_attributes.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,10 @@ def test_private_module_alias_access() -> None:
120120

121121
# Each should have warned exactly once, and note what to use instead.
122122
messages = [str(w.message) for w in ctx]
123-
for target, message in zip(_PRIVATE_MODULE_ALIAS_TARGETS, messages, strict=True):
123+
124+
assert len(messages) == len(_PRIVATE_MODULE_ALIAS_TARGETS)
125+
126+
for target, message in zip(_PRIVATE_MODULE_ALIAS_TARGETS, messages):
124127
assert message.endswith(f"Use {target.__name__} instead.")
125128

126129

@@ -153,5 +156,8 @@ def test_private_module_alias_import() -> None:
153156
# each import, all messages should be the same and should note what to use instead.
154157
messages_with_duplicates = [str(w.message) for w in ctx]
155158
messages = [message for message, _ in itertools.groupby(messages_with_duplicates)]
156-
for target, message in zip(_PRIVATE_MODULE_ALIAS_TARGETS, messages, strict=True):
159+
160+
assert len(messages) == len(_PRIVATE_MODULE_ALIAS_TARGETS)
161+
162+
for target, message in zip(_PRIVATE_MODULE_ALIAS_TARGETS, messages):
157163
assert message.endswith(f"Use {target.__name__} instead.")

0 commit comments

Comments
 (0)