Skip to content

Commit

Permalink
Remove with_wheel fixture
Browse files Browse the repository at this point in the history
We install wheel by default in our test env.
  • Loading branch information
sbidoul committed Mar 18, 2023
1 parent f383dc8 commit d32afa6
Show file tree
Hide file tree
Showing 18 changed files with 2 additions and 96 deletions.
5 changes: 0 additions & 5 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -503,11 +503,6 @@ def virtualenv(
yield virtualenv_factory(tmpdir.joinpath("workspace", "venv"))


@pytest.fixture
def with_wheel(virtualenv: VirtualEnvironment, wheel_install: Path) -> None:
pass


class ScriptFactory(Protocol):
def __call__(
self,
Expand Down
2 changes: 0 additions & 2 deletions tests/functional/test_download.py
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,6 @@ def make_wheel_with_python_requires(
return package_dir / "dist" / file_name


@pytest.mark.usefixtures("with_wheel")
def test_download__python_version_used_for_python_requires(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -700,7 +699,6 @@ def make_args(python_version: str) -> List[str]:
script.pip(*args) # no exception


@pytest.mark.usefixtures("with_wheel")
def test_download_ignore_requires_python_dont_fail_with_wrong_python(
script: PipTestEnvironment,
) -> None:
Expand Down
3 changes: 0 additions & 3 deletions tests/functional/test_freeze.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def test_exclude_and_normalization(script: PipTestEnvironment, tmpdir: Path) ->
assert "Normalizable_Name" not in result.stdout


@pytest.mark.usefixtures("with_wheel")
def test_freeze_multiple_exclude_with_all(script: PipTestEnvironment) -> None:
result = script.pip("freeze", "--all")
assert "pip==" in result.stdout
Expand Down Expand Up @@ -962,7 +961,6 @@ def test_freeze_path_multiple(
_check_output(result.stdout, expected)


@pytest.mark.usefixtures("with_wheel")
def test_freeze_direct_url_archive(
script: PipTestEnvironment, shared_data: TestData
) -> None:
Expand Down Expand Up @@ -1005,7 +1003,6 @@ def test_freeze_include_work_dir_pkg(script: PipTestEnvironment) -> None:
assert "simple==1.0" in result.stdout


@pytest.mark.usefixtures("with_wheel")
def test_freeze_pep610_editable(script: PipTestEnvironment) -> None:
"""
Test that a package installed with a direct_url.json with editable=true
Expand Down
28 changes: 0 additions & 28 deletions tests/functional/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ def test_pep518_forkbombs(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_pip_second_command_line_interface_works(
script: PipTestEnvironment,
pip_src: Path,
Expand Down Expand Up @@ -317,7 +316,6 @@ def test_install_exit_status_code_when_blank_requirements_file(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_basic_install_from_pypi(script: PipTestEnvironment) -> None:
"""
Test installing a package from PyPI.
Expand Down Expand Up @@ -376,7 +374,6 @@ def test_basic_install_editable_from_git(script: PipTestEnvironment) -> None:
_test_install_editable_from_git(script)


@pytest.mark.usefixtures("with_wheel")
def test_install_editable_from_git_autobuild_wheel(script: PipTestEnvironment) -> None:
_test_install_editable_from_git(script)

Expand Down Expand Up @@ -503,7 +500,6 @@ def test_vcs_url_urlquote_normalization(


@pytest.mark.parametrize("resolver", ["", "--use-deprecated=legacy-resolver"])
@pytest.mark.usefixtures("with_wheel")
def test_basic_install_from_local_directory(
script: PipTestEnvironment, data: TestData, resolver: str
) -> None:
Expand Down Expand Up @@ -533,7 +529,6 @@ def test_basic_install_from_local_directory(
("embedded_rel_path", True),
],
)
@pytest.mark.usefixtures("with_wheel")
def test_basic_install_relative_directory(
script: PipTestEnvironment, data: TestData, test_type: str, editable: bool
) -> None:
Expand Down Expand Up @@ -655,7 +650,6 @@ def test_hashed_install_failure_later_flag(
)


@pytest.mark.usefixtures("with_wheel")
def test_install_from_local_directory_with_in_tree_build(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -800,7 +794,6 @@ def test_upgrade_argparse_shadowed(script: PipTestEnvironment) -> None:
assert "Not uninstalling argparse" not in result.stdout


@pytest.mark.usefixtures("with_wheel")
def test_install_curdir(script: PipTestEnvironment, data: TestData) -> None:
"""
Test installing current directory ('.').
Expand All @@ -817,7 +810,6 @@ def test_install_curdir(script: PipTestEnvironment, data: TestData) -> None:
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_install_pardir(script: PipTestEnvironment, data: TestData) -> None:
"""
Test installing parent directory ('..').
Expand Down Expand Up @@ -877,7 +869,6 @@ def test_install_global_option_using_editable(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_install_package_with_same_name_in_curdir(script: PipTestEnvironment) -> None:
"""
Test installing a package with the same name of a local folder
Expand All @@ -896,7 +887,6 @@ def test_install_package_with_same_name_in_curdir(script: PipTestEnvironment) ->
)


@pytest.mark.usefixtures("with_wheel")
def test_install_folder_using_dot_slash(script: PipTestEnvironment) -> None:
"""
Test installing a folder using pip install ./foldername
Expand All @@ -909,7 +899,6 @@ def test_install_folder_using_dot_slash(script: PipTestEnvironment) -> None:
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_install_folder_using_slash_in_the_end(script: PipTestEnvironment) -> None:
r"""
Test installing a folder using pip install foldername/ or foldername\
Expand All @@ -922,7 +911,6 @@ def test_install_folder_using_slash_in_the_end(script: PipTestEnvironment) -> No
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_install_folder_using_relative_path(script: PipTestEnvironment) -> None:
"""
Test installing a folder using pip install folder1/folder2
Expand All @@ -937,7 +925,6 @@ def test_install_folder_using_relative_path(script: PipTestEnvironment) -> None:


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_install_package_which_contains_dev_in_name(script: PipTestEnvironment) -> None:
"""
Test installing package from PyPI which contains 'dev' in name
Expand All @@ -949,7 +936,6 @@ def test_install_package_which_contains_dev_in_name(script: PipTestEnvironment)
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_install_package_with_target(script: PipTestEnvironment) -> None:
"""
Test installing a package using pip install --target
Expand Down Expand Up @@ -1082,7 +1068,6 @@ def test_install_nonlocal_compatible_wheel_path(


@pytest.mark.parametrize("opt", ("--target", "--prefix"))
@pytest.mark.usefixtures("with_wheel")
def test_install_with_target_or_prefix_and_scripts_no_warning(
opt: str, script: PipTestEnvironment
) -> None:
Expand Down Expand Up @@ -1121,7 +1106,6 @@ def main(): pass
assert "--no-warn-script-location" not in result.stderr, str(result)


@pytest.mark.usefixtures("with_wheel")
def test_install_package_with_root(script: PipTestEnvironment, data: TestData) -> None:
"""
Test installing a package using pip install --root
Expand Down Expand Up @@ -1318,7 +1302,6 @@ def test_install_package_with_latin1_setup(
script.pip("install", to_install)


@pytest.mark.usefixtures("with_wheel")
def test_url_req_case_mismatch_no_index(
script: PipTestEnvironment, data: TestData
) -> None:
Expand All @@ -1342,7 +1325,6 @@ def test_url_req_case_mismatch_no_index(
result.did_not_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_url_req_case_mismatch_file_index(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -1372,7 +1354,6 @@ def test_url_req_case_mismatch_file_index(
result.did_not_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_url_incorrect_case_no_index(
script: PipTestEnvironment, data: TestData
) -> None:
Expand All @@ -1396,7 +1377,6 @@ def test_url_incorrect_case_no_index(
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_url_incorrect_case_file_index(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -1546,15 +1526,13 @@ def test_install_topological_sort(script: PipTestEnvironment, data: TestData) ->
assert order1 in res or order2 in res, res


@pytest.mark.usefixtures("with_wheel")
def test_install_wheel_broken(script: PipTestEnvironment) -> None:
res = script.pip_install_local("wheelbroken", allow_stderr_error=True)
assert "ERROR: Failed building wheel for wheelbroken" in res.stderr
# Fallback to setup.py install (https://github.com/pypa/pip/issues/8368)
assert "Successfully installed wheelbroken-0.1" in str(res), str(res)


@pytest.mark.usefixtures("with_wheel")
def test_cleanup_after_failed_wheel(script: PipTestEnvironment) -> None:
res = script.pip_install_local("wheelbrokenafter", allow_stderr_error=True)
assert "ERROR: Failed building wheel for wheelbrokenafter" in res.stderr
Expand All @@ -1569,7 +1547,6 @@ def test_cleanup_after_failed_wheel(script: PipTestEnvironment) -> None:
assert "Running setup.py clean for wheelbrokenafter" in str(res), str(res)


@pytest.mark.usefixtures("with_wheel")
def test_install_builds_wheels(script: PipTestEnvironment, data: TestData) -> None:
# We need to use a subprocess to get the right value on Windows.
res = script.run(
Expand Down Expand Up @@ -1622,7 +1599,6 @@ def test_install_builds_wheels(script: PipTestEnvironment, data: TestData) -> No
]


@pytest.mark.usefixtures("with_wheel")
def test_install_no_binary_disables_building_wheels(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -1653,7 +1629,6 @@ def test_install_no_binary_disables_building_wheels(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_install_no_binary_builds_pep_517_wheel(
script: PipTestEnvironment, data: TestData
) -> None:
Expand All @@ -1668,7 +1643,6 @@ def test_install_no_binary_builds_pep_517_wheel(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_install_no_binary_uses_local_backend(
script: PipTestEnvironment, data: TestData, tmpdir: Path
) -> None:
Expand All @@ -1682,7 +1656,6 @@ def test_install_no_binary_uses_local_backend(
assert os.path.isfile(marker), "Local PEP 517 backend not used"


@pytest.mark.usefixtures("with_wheel")
def test_install_no_binary_disables_cached_wheels(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -1821,7 +1794,6 @@ def test_install_incompatible_python_requires_editable(
assert _get_expected_error_text() in result.stderr, str(result)


@pytest.mark.usefixtures("with_wheel")
def test_install_incompatible_python_requires_wheel(script: PipTestEnvironment) -> None:
script.scratch_path.joinpath("pkga").mkdir()
pkga_path = script.scratch_path / "pkga"
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_install_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ def test_no_clean_option_blocks_cleaning_after_install(


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_pep517_no_legacy_cleanup(script: PipTestEnvironment, data: TestData) -> None:
"""Test a PEP 517 failed build does not attempt a legacy cleanup"""
to_install = data.packages.joinpath("pep517_wrapper_buildsys")
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_install_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ def test_options_from_venv_config(
assert msg.lower() in result.stdout.lower(), str(result)


@pytest.mark.usefixtures("with_wheel")
def test_install_no_binary_via_config_disables_cached_wheels(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down
6 changes: 0 additions & 6 deletions tests/functional/test_install_direct_url.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,11 @@
from tests.lib.direct_url import get_created_direct_url


@pytest.mark.usefixtures("with_wheel")
def test_install_find_links_no_direct_url(script: PipTestEnvironment) -> None:
result = script.pip_install_local("simple")
assert not get_created_direct_url(result, "simple")


@pytest.mark.usefixtures("with_wheel")
def test_install_vcs_editable_no_direct_url(script: PipTestEnvironment) -> None:
pkg_path = _create_test_package(script.scratch_path, name="testpkg")
args = ["install", "-e", f"git+{pkg_path.as_uri()}#egg=testpkg"]
Expand All @@ -21,7 +19,6 @@ def test_install_vcs_editable_no_direct_url(script: PipTestEnvironment) -> None:
assert not get_created_direct_url(result, "testpkg")


@pytest.mark.usefixtures("with_wheel")
def test_install_vcs_non_editable_direct_url(script: PipTestEnvironment) -> None:
pkg_path = _create_test_package(script.scratch_path, name="testpkg")
url = pkg_path.as_uri()
Expand All @@ -34,7 +31,6 @@ def test_install_vcs_non_editable_direct_url(script: PipTestEnvironment) -> None
assert direct_url.info.vcs == "git"


@pytest.mark.usefixtures("with_wheel")
def test_install_archive_direct_url(script: PipTestEnvironment, data: TestData) -> None:
req = "simple @ " + data.packages.joinpath("simple-2.0.tar.gz").as_uri()
assert req.startswith("simple @ file://")
Expand All @@ -43,7 +39,6 @@ def test_install_archive_direct_url(script: PipTestEnvironment, data: TestData)


@pytest.mark.network
@pytest.mark.usefixtures("with_wheel")
def test_install_vcs_constraint_direct_url(script: PipTestEnvironment) -> None:
constraints_file = script.scratch_path / "constraints.txt"
constraints_file.write_text(
Expand All @@ -55,7 +50,6 @@ def test_install_vcs_constraint_direct_url(script: PipTestEnvironment) -> None:
assert get_created_direct_url(result, "pip_test_package")


@pytest.mark.usefixtures("with_wheel")
def test_install_vcs_constraint_direct_file_url(script: PipTestEnvironment) -> None:
pkg_path = _create_test_package(script.scratch_path, name="testpkg")
url = pkg_path.as_uri()
Expand Down
7 changes: 0 additions & 7 deletions tests/functional/test_install_index.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
import shutil
import textwrap

import pytest

from tests.lib import PipTestEnvironment, TestData


@pytest.mark.usefixtures("with_wheel")
def test_find_links_relative_path(script: PipTestEnvironment, data: TestData) -> None:
"""Test find-links as a relative path."""
result = script.pip(
Expand All @@ -23,7 +20,6 @@ def test_find_links_relative_path(script: PipTestEnvironment, data: TestData) ->
result.did_create(initools_folder)


@pytest.mark.usefixtures("with_wheel")
def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> None:
shutil.copy(data.packages / "simple-1.0.tar.gz", script.scratch_path)
html = script.scratch_path.joinpath("index.html")
Expand All @@ -39,7 +35,6 @@ def test_find_links_no_doctype(script: PipTestEnvironment, data: TestData) -> No
assert not result.stderr


@pytest.mark.usefixtures("with_wheel")
def test_find_links_requirements_file_relative_path(
script: PipTestEnvironment, data: TestData
) -> None:
Expand Down Expand Up @@ -67,7 +62,6 @@ def test_find_links_requirements_file_relative_path(
result.did_create(initools_folder)


@pytest.mark.usefixtures("with_wheel")
def test_install_from_file_index_hash_link(
script: PipTestEnvironment, data: TestData
) -> None:
Expand All @@ -80,7 +74,6 @@ def test_install_from_file_index_hash_link(
result.did_create(dist_info_folder)


@pytest.mark.usefixtures("with_wheel")
def test_file_index_url_quoting(script: PipTestEnvironment, data: TestData) -> None:
"""
Test url quoting of file index url with a space
Expand Down
Loading

0 comments on commit d32afa6

Please sign in to comment.