Skip to content

Commit 864139a

Browse files
committed
add tests
1 parent 38126ce commit 864139a

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed

tests/functional/test_install.py

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2459,6 +2459,40 @@ def test_install_pip_prints_req_chain_local(script: PipTestEnvironment) -> None:
24592459
)
24602460

24612461

2462+
def test_install_dist_restriction_without_target(script: PipTestEnvironment) -> None:
2463+
result = script.pip(
2464+
"install", "--python-version=3.1", "--only-binary=:all:", expect_error=True
2465+
)
2466+
assert (
2467+
"Can not use any platform or abi specific options unless installing "
2468+
"via '--target'" in result.stderr
2469+
), str(result)
2470+
2471+
2472+
def test_install_dist_restriction_dry_run_doesnt_require_target(
2473+
script: PipTestEnvironment,
2474+
) -> None:
2475+
create_basic_wheel_for_package(
2476+
script,
2477+
"base",
2478+
"0.1.0",
2479+
)
2480+
2481+
result = script.pip(
2482+
"install",
2483+
"--python-version=3.1",
2484+
"--only-binary=:all:",
2485+
"--dry-run",
2486+
"--no-cache-dir",
2487+
"--no-index",
2488+
"--find-links",
2489+
script.scratch_path,
2490+
"base",
2491+
)
2492+
2493+
assert not result.stderr, str(result)
2494+
2495+
24622496
@pytest.mark.network
24632497
def test_install_pip_prints_req_chain_pypi(script: PipTestEnvironment) -> None:
24642498
"""

0 commit comments

Comments
 (0)