Skip to content

Commit 246cc17

Browse files
committed
Use names directly on other tests
The tests are written broadly (per the style elsewhere in this test suite), but narrowing the message-checking tests in this specific way has the further advantage that the logic of the code under test will be less reflected in the logic of the tests, so that bugs are less likely to be missed by being duplicated across code and tests.
1 parent 3fe2f15 commit 246cc17

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

‎test/deprecation/test_toplevel.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def test_private_module_alias_access() -> None:
141141

142142
assertlen(messages) ==len(_PRIVATE_MODULE_ALIAS_TARGETS)
143143

144-
fortarget, messageinzip(_PRIVATE_MODULE_ALIAS_TARGETS, messages):
145-
assertmessage.endswith(f"Use {target.__name__} instead.")
144+
forfullname, messageinzip(_PRIVATE_MODULE_ALIAS_TARGET_NAMES, messages):
145+
assertmessage.endswith(f"Use {fullname} instead.")
146146

147147

148148
deftest_private_module_alias_import() ->None:
@@ -177,8 +177,8 @@ def test_private_module_alias_import() -> None:
177177

178178
assertlen(messages) ==len(_PRIVATE_MODULE_ALIAS_TARGETS)
179179

180-
fortarget, messageinzip(_PRIVATE_MODULE_ALIAS_TARGETS, messages):
181-
assertmessage.endswith(f"Use {target.__name__} instead.")
180+
forfullname, messageinzip(_PRIVATE_MODULE_ALIAS_TARGET_NAMES, messages):
181+
assertmessage.endswith(f"Use {fullname} instead.")
182182

183183

184184
deftest_dir_contains_public_attributes() ->None:

0 commit comments

Comments
(0)