mirror of
https://github.com/pypa/pip
synced 2023-12-13 21:30:23 +01:00
Parametrize editable for relative install tests
This commit is contained in:
parent
2801de5825
commit
f89013daa4
|
@ -406,12 +406,15 @@ def test_basic_install_from_local_directory(script, data):
|
||||||
assert egg_info_folder in result.files_created, str(result)
|
assert egg_info_folder in result.files_created, str(result)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("test_type", [
|
@pytest.mark.parametrize("test_type,editable", [
|
||||||
("rel_path"),
|
("rel_path", False),
|
||||||
("rel_url"),
|
("rel_path", True),
|
||||||
("embedded_rel_path"),
|
("rel_url", False),
|
||||||
|
("rel_url", True),
|
||||||
|
("embedded_rel_path", False),
|
||||||
|
("embedded_rel_path", True),
|
||||||
])
|
])
|
||||||
def test_basic_install_relative_directory(script, data, test_type):
|
def test_basic_install_relative_directory(script, data, test_type, editable):
|
||||||
"""
|
"""
|
||||||
Test installing a requirement using a relative path.
|
Test installing a requirement using a relative path.
|
||||||
"""
|
"""
|
||||||
|
@ -439,14 +442,13 @@ def test_basic_install_relative_directory(script, data, test_type):
|
||||||
}[test_type]
|
}[test_type]
|
||||||
|
|
||||||
# Install as either editable or not.
|
# Install as either editable or not.
|
||||||
if True:
|
if not editable:
|
||||||
# Regular install.
|
|
||||||
result = script.pip('install', req_path,
|
result = script.pip('install', req_path,
|
||||||
cwd=script.scratch_path)
|
cwd=script.scratch_path)
|
||||||
assert egg_info_file in result.files_created, str(result)
|
assert egg_info_file in result.files_created, str(result)
|
||||||
assert package_folder in result.files_created, str(result)
|
assert package_folder in result.files_created, str(result)
|
||||||
script.pip('uninstall', '-y', 'fspkg')
|
script.pip('uninstall', '-y', 'fspkg')
|
||||||
|
else:
|
||||||
# Editable install.
|
# Editable install.
|
||||||
result = script.pip('install', '-e' + req_path,
|
result = script.pip('install', '-e' + req_path,
|
||||||
cwd=script.scratch_path)
|
cwd=script.scratch_path)
|
||||||
|
|
|
@ -57,12 +57,15 @@ def test_schema_check_in_requirements_file(script):
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("test_type", [
|
@pytest.mark.parametrize("test_type,editable", [
|
||||||
("rel_path"),
|
("rel_path", False),
|
||||||
("rel_url"),
|
("rel_path", True),
|
||||||
("embedded_rel_path"),
|
("rel_url", False),
|
||||||
|
("rel_url", True),
|
||||||
|
("embedded_rel_path", False),
|
||||||
|
("embedded_rel_path", True),
|
||||||
])
|
])
|
||||||
def test_relative_requirements_file(script, data, test_type):
|
def test_relative_requirements_file(script, data, test_type, editable):
|
||||||
"""
|
"""
|
||||||
Test installing from a requirements file with a relative path. For path
|
Test installing from a requirements file with a relative path. For path
|
||||||
URLs, use an egg= definition.
|
URLs, use an egg= definition.
|
||||||
|
@ -89,10 +92,9 @@ def test_relative_requirements_file(script, data, test_type):
|
||||||
"embedded_rel_path": embedded_rel_path,
|
"embedded_rel_path": embedded_rel_path,
|
||||||
}[test_type]
|
}[test_type]
|
||||||
|
|
||||||
|
req_path = req_path.replace(os.path.sep, '/')
|
||||||
# Install as either editable or not.
|
# Install as either editable or not.
|
||||||
if True:
|
if not editable:
|
||||||
req_path = req_path.replace(os.path.sep, '/')
|
|
||||||
# Regular install.
|
|
||||||
with requirements_file(req_path + '\n',
|
with requirements_file(req_path + '\n',
|
||||||
script.scratch_path) as reqs_file:
|
script.scratch_path) as reqs_file:
|
||||||
result = script.pip('install', '-vvv', '-r', reqs_file.name,
|
result = script.pip('install', '-vvv', '-r', reqs_file.name,
|
||||||
|
@ -100,8 +102,7 @@ def test_relative_requirements_file(script, data, test_type):
|
||||||
assert egg_info_file in result.files_created, str(result)
|
assert egg_info_file in result.files_created, str(result)
|
||||||
assert package_folder in result.files_created, str(result)
|
assert package_folder in result.files_created, str(result)
|
||||||
script.pip('uninstall', '-y', 'fspkg')
|
script.pip('uninstall', '-y', 'fspkg')
|
||||||
|
else:
|
||||||
# Editable install.
|
|
||||||
with requirements_file('-e ' + req_path + '\n',
|
with requirements_file('-e ' + req_path + '\n',
|
||||||
script.scratch_path) as reqs_file:
|
script.scratch_path) as reqs_file:
|
||||||
result = script.pip('install', '-vvv', '-r', reqs_file.name,
|
result = script.pip('install', '-vvv', '-r', reqs_file.name,
|
||||||
|
|
Loading…
Reference in a new issue