Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

Commit3fe2f15

Browse files
committed
Test that top-level aliases point to modules with normal __name__
1 parent05e0878 commit3fe2f15

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

‎test/deprecation/test_toplevel.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,26 @@ def test_util_alias_import() -> None:
102102
"""Targets of private aliases in the git module to some modules, not including util."""
103103

104104

105+
_PRIVATE_MODULE_ALIAS_TARGET_NAMES= (
106+
"git.refs.head",
107+
"git.refs.log",
108+
"git.refs.reference",
109+
"git.refs.symbolic",
110+
"git.refs.tag",
111+
"git.index.base",
112+
"git.index.fun",
113+
"git.index.typ",
114+
)
115+
"""Expected ``__name__`` attributes of targets of private aliases in the git module."""
116+
117+
118+
deftest_alias_target_module_names_are_by_location()->None:
119+
"""The aliases are weird, but their targets are normal, even in ``__name__``."""
120+
actual= [module.__name__formodulein_PRIVATE_MODULE_ALIAS_TARGETS]
121+
expected=list(_PRIVATE_MODULE_ALIAS_TARGET_NAMES)
122+
assertactual==expected
123+
124+
105125
deftest_private_module_alias_access()->None:
106126
"""Non-util private alias access works but warns and is a deliberate mypy error."""
107127
withpytest.deprecated_call()asctx:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp