1
1
Fork 0
mirror of https://github.com/pypa/pip synced 2023-12-13 21:30:23 +01:00
pip/tests/functional/test_install_cleanup.py

41 lines
1.3 KiB
Python
Raw Normal View History

from os.path import exists
2017-05-16 12:16:30 +02:00
import pytest
2015-01-15 00:53:15 +01:00
@pytest.mark.network
2021-08-13 15:23:45 +02:00
@pytest.mark.xfail(reason="The --build option was removed")
def test_no_clean_option_blocks_cleaning_after_install(script, data):
2013-03-27 06:26:52 +01:00
"""
2013-05-25 02:11:15 +02:00
Test --no-clean option blocks cleaning after install
2013-03-27 06:26:52 +01:00
"""
2021-08-13 15:23:45 +02:00
build = script.base_path / "pip-build"
script.pip(
2021-08-13 15:23:45 +02:00
"install",
"--no-clean",
"--no-index",
"--build",
build,
f"--find-links={data.find_links}",
"simple",
2020-06-01 12:28:18 +02:00
expect_temp=True,
# TODO: allow_stderr_warning is used for the --build deprecation,
# remove it when removing support for --build
allow_stderr_warning=True,
)
assert exists(build)
2013-05-25 02:11:15 +02:00
@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_pep517_no_legacy_cleanup(script, data):
"""Test a PEP 517 failed build does not attempt a legacy cleanup"""
2021-08-13 15:23:45 +02:00
to_install = data.packages.joinpath("pep517_wrapper_buildsys")
script.environ["PIP_TEST_FAIL_BUILD_WHEEL"] = "1"
2021-08-13 15:23:45 +02:00
res = script.pip("install", "-f", data.find_links, to_install, expect_error=True)
# Must not have built the package
expected = "Failed building wheel for pep517-wrapper-buildsys"
assert expected in str(res)
# Must not have attempted legacy cleanup
assert "setup.py clean" not in str(res)