@@ -85,7 +85,7 @@ def test_util_alias_import() -> None:
85
85
86
86
87
87
# Split out util and have all its tests be separate, above.
88
- _MODULE_ALIAS_TARGETS = (
88
+ _PRIVATE_MODULE_ALIAS_TARGETS = (
89
89
git .refs .head ,
90
90
git .refs .log ,
91
91
git .refs .reference ,
@@ -95,6 +95,7 @@ def test_util_alias_import() -> None:
95
95
git .index .fun ,
96
96
git .index .typ ,
97
97
)
98
+ """Targets of private aliases in the git module to some modules, not including util."""
98
99
99
100
100
101
def test_private_module_alias_access () -> None :
@@ -109,11 +110,11 @@ def test_private_module_alias_access() -> None:
109
110
git .base , # type: ignore[attr-defined]
110
111
git .fun , # type: ignore[attr-defined]
111
112
git .typ , # type: ignore[attr-defined]
112
- ) == _MODULE_ALIAS_TARGETS
113
+ ) == _PRIVATE_MODULE_ALIAS_TARGETS
113
114
114
115
# Each should have warned exactly once, and note what to use instead.
115
116
messages = [str (w .message ) for w in ctx ]
116
- for target , message in zip (_MODULE_ALIAS_TARGETS , messages , strict = True ):
117
+ for target , message in zip (_PRIVATE_MODULE_ALIAS_TARGETS , messages , strict = True ):
117
118
assert message .endswith (f"Use { target .__name__ } instead." )
118
119
119
120
@@ -138,13 +139,13 @@ def test_private_module_alias_import() -> None:
138
139
base ,
139
140
fun ,
140
141
typ ,
141
- ) == _MODULE_ALIAS_TARGETS
142
+ ) == _PRIVATE_MODULE_ALIAS_TARGETS
142
143
143
144
# Each import may warn multiple times. In CPython there will be currently always be
144
145
# exactly two warnings per import, possibly due to the equivalent of calling hasattr
145
146
# to do a pre-check prior to retrieving the attribute for actual use. However, for
146
147
# each import, all messages should be the same and should note what to use instead.
147
148
messages_with_duplicates = [str (w .message ) for w in ctx ]
148
149
messages = [message for message , _ in itertools .groupby (messages_with_duplicates )]
149
- for target , message in zip (_MODULE_ALIAS_TARGETS , messages , strict = True ):
150
+ for target , message in zip (_PRIVATE_MODULE_ALIAS_TARGETS , messages , strict = True ):
150
151
assert message .endswith (f"Use { target .__name__ } instead." )
0 commit comments