Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 7a4f7eb

Browse filesBrowse 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
Copy full SHA for 7a4f7eb

File tree

Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+8
-2
lines changed

‎test/deprecation/test_attributes.py

Copy file name to clipboardExpand all lines: test/deprecation/test_attributes.py
+8-2Lines changed: 8 additions & 2 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.