Skip to content

Commit f92961d

Browse files
committed
More descriptive function name.
1 parent 3da9a89 commit f92961d

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed

src/pip/_internal/wheel.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,15 +316,15 @@ class MissingCallableSuffix(Exception):
316316
pass
317317

318318

319-
def _assert_valid_entrypoint(specification):
319+
def _raise_for_invalid_entrypoint(specification):
320320
entry = get_export_entry(specification)
321321
if entry is not None and entry.suffix is None:
322322
raise MissingCallableSuffix(str(entry))
323323

324324

325325
class PipScriptMaker(ScriptMaker):
326326
def make(self, specification, options=None):
327-
_assert_valid_entrypoint(specification)
327+
_raise_for_invalid_entrypoint(specification)
328328
return super(PipScriptMaker, self).make(specification, options)
329329

330330

tests/unit/test_wheel.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@
1515
from pip._internal.req.req_install import InstallRequirement
1616
from pip._internal.utils.compat import WINDOWS
1717
from pip._internal.utils.misc import unpack_file
18-
from pip._internal.wheel import MissingCallableSuffix, _assert_valid_entrypoint
18+
from pip._internal.wheel import (
19+
MissingCallableSuffix,
20+
_raise_for_invalid_entrypoint,
21+
)
1922
from tests.lib import DATA_DIR, assert_paths_equal
2023

2124

@@ -266,17 +269,17 @@ def test_get_entrypoints(tmpdir, console_scripts):
266269
)
267270

268271

269-
def test_assert_valid_entrypoint_ok():
270-
_assert_valid_entrypoint("hello = hello:main")
272+
def test_raise_for_invalid_entrypoint_ok():
273+
_raise_for_invalid_entrypoint("hello = hello:main")
271274

272275

273276
@pytest.mark.parametrize("entrypoint", [
274277
"hello = hello",
275278
"hello = hello:",
276279
])
277-
def test_assert_valid_entrypoint_fail(entrypoint):
280+
def test_raise_for_invalid_entrypoint_fail(entrypoint):
278281
with pytest.raises(MissingCallableSuffix):
279-
_assert_valid_entrypoint(entrypoint)
282+
_raise_for_invalid_entrypoint(entrypoint)
280283

281284

282285
@pytest.mark.parametrize("outrows, expected", [

0 commit comments

Comments
 (0)