mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
working on adding tests. It looks like the case of multiple extras not exisiting isn't handled
This commit is contained in:
parent
91f80102dd
commit
fec9f4fde9
|
@ -443,7 +443,9 @@ class RequirementSet(object):
|
|||
# req_to_install.extras are the extras
|
||||
# the user *would like* to install.
|
||||
# how to get the available options
|
||||
print req_to_install.extras
|
||||
# _dep_map has both extras and something else
|
||||
# but it is: [Requirement.parse('simple==1.0')]
|
||||
print dist._dep_map # maybe?
|
||||
for subreq in dist.requires(
|
||||
req_to_install.extras):
|
||||
if self.has_requirement(
|
||||
|
|
|
@ -2,57 +2,76 @@
|
|||
temporarily locate test here to make it fail faster
|
||||
"""
|
||||
|
||||
# def test_non_existant_extra_warns_user_with_wheel(script, data):
|
||||
# """
|
||||
# A warning is logged telling the user that the extra option they requested
|
||||
# does not exist in the project they are wishing to install
|
||||
# """
|
||||
# result = script.pip(
|
||||
# 'install', '--use-wheel', '--no-index',
|
||||
# '--find-links=' + data.find_links,
|
||||
# 'simplewheel[nonexistant]', expect_stderr=True,
|
||||
# )
|
||||
# assert (
|
||||
# "simplewheel 2.0 has no such extra feature 'nonexistant'"
|
||||
# in result.stdout
|
||||
# )
|
||||
def test_non_existant_extra_warns_user_with_wheel(script, data):
|
||||
"""
|
||||
A warning is logged telling the user that the extra option they requested
|
||||
does not exist in the project they are wishing to install
|
||||
"""
|
||||
result = script.pip(
|
||||
'install', '--use-wheel', '--no-index',
|
||||
'--find-links=' + data.find_links,
|
||||
'simplewheel[nonexistant]', expect_stderr=True,
|
||||
)
|
||||
assert (
|
||||
"simplewheel 2.0 has no such extra feature 'nonexistant'"
|
||||
in result.stdout
|
||||
)
|
||||
|
||||
# def test_non_existant_extra_warns_user_no_wheel(script, data):
|
||||
# """
|
||||
# A warning is logged telling the user that the extra option they requested
|
||||
# does not exist in the project they are wishing to install.
|
||||
def test_non_existant_extra_warns_user_no_wheel(script, data):
|
||||
"""
|
||||
A warning is logged telling the user that the extra option they requested
|
||||
does not exist in the project they are wishing to install.
|
||||
|
||||
# This is meant to exercise the code that is meant for non-wheel installs.
|
||||
# """
|
||||
# result = script.pip(
|
||||
# 'install', '--no-use-wheel', '--no-index',
|
||||
# '--find-links=' + data.find_links,
|
||||
# 'simple[nonexistant]', expect_stderr=True,
|
||||
# )
|
||||
# assert (
|
||||
# "simple 3.0 has no such extra feature 'nonexistant'"
|
||||
# in result.stdout
|
||||
# )
|
||||
This is meant to exercise the code that is meant for non-wheel installs.
|
||||
"""
|
||||
result = script.pip(
|
||||
'install', '--no-use-wheel', '--no-index',
|
||||
'--find-links=' + data.find_links,
|
||||
'simple[nonexistant]', expect_stderr=True,
|
||||
)
|
||||
assert (
|
||||
"simple 3.0 has no such extra feature 'nonexistant'"
|
||||
in result.stdout
|
||||
)
|
||||
|
||||
# def test_non_existant_extras_warn_user_no_wheel(script, data):
|
||||
# """
|
||||
# Warn the user for each extra that doesn't exist.
|
||||
# """
|
||||
# result = script.pip(
|
||||
# 'install', '--use-wheel', '--no-index',
|
||||
# '--find-links=' + data.find_links,
|
||||
# 'simplewheel[nonexistant]', expect_stderr=True,
|
||||
# )
|
||||
# assert (
|
||||
# "simple 3.0 has no such extra feature 'nonexistant'"
|
||||
# in result.stdout
|
||||
# )
|
||||
# assert (
|
||||
# "simple 3.0 has no such extra feature 'nope'"
|
||||
# in result.stdout
|
||||
# )
|
||||
def test_non_existant_extras_warn_user_with_wheel(script, data):
|
||||
"""
|
||||
Warn the user for each extra that doesn't exist.
|
||||
"""
|
||||
result = script.pip(
|
||||
'install', '--use-wheel', '--no-index',
|
||||
'--find-links=' + data.find_links,
|
||||
'simplewheel[nonexistant]', expect_stderr=True,
|
||||
)
|
||||
assert (
|
||||
"simplewheel 2.0 has no such extra feature 'nonexistant'"
|
||||
in result.stdout
|
||||
)
|
||||
assert (
|
||||
"simplewheel 2.0 has no such extra feature 'nope'"
|
||||
in result.stdout
|
||||
)
|
||||
|
||||
def test_shows_existing_extrasl(script, data):
|
||||
def test_non_existant_extras_warn_user_with_wheel(script, data):
|
||||
"""
|
||||
Warn the user for each extra that doesn't exist.
|
||||
"""
|
||||
result = script.pip(
|
||||
'install', '--no-use-wheel', '--no-index',
|
||||
'--find-links=' + data.find_links,
|
||||
'simple[nonexistant, nope]', expect_stderr=True,
|
||||
)
|
||||
assert (
|
||||
"simple 3.0 has no such extra feature 'nonexistant'"
|
||||
in result.stdout
|
||||
)
|
||||
assert (
|
||||
"simple 3.0 has no such extra feature 'nope'"
|
||||
in result.stdout
|
||||
)
|
||||
|
||||
# this is just meant to be used for development
|
||||
def test_shows_existing_available_extras(script, data):
|
||||
"""
|
||||
Warn the user for each extra that doesn't exist.
|
||||
"""
|
||||
|
|
Loading…
Reference in a new issue