@@ -829,7 +829,10 @@ def test_install_global_option(script: PipTestEnvironment) -> None:
829
829
(In particular those that disable the actual install action)
830
830
"""
831
831
result = script .pip (
832
- "install" , "--global-option=--version" , "INITools==0.1" , expect_stderr = True
832
+ "install" ,
833
+ "--global-option=--version" ,
834
+ "INITools==0.1" ,
835
+ expect_error = True , # build is going to fail because of --version
833
836
)
834
837
assert "INITools==0.1\n " in result .stdout
835
838
assert not result .files_created
@@ -1498,15 +1501,12 @@ def test_install_subprocess_output_handling(
1498
1501
# This error is emitted 3 times:
1499
1502
# - by setup.py bdist_wheel
1500
1503
# - by setup.py clean
1501
- # - by setup.py install which is used as fallback when setup.py bdist_wheel failed
1502
- # Before, it failed only once because it attempted only setup.py install.
1503
- # TODO update this when we remove the last setup.py install code path.
1504
- assert 3 == result .stderr .count ("I DIE, I DIE" )
1504
+ assert 2 == result .stderr .count ("I DIE, I DIE" )
1505
1505
1506
1506
result = script .pip (
1507
1507
* (args + ["--global-option=--fail" , "--verbose" ]), expect_error = True
1508
1508
)
1509
- assert 3 == result .stderr .count ("I DIE, I DIE" )
1509
+ assert 2 == result .stderr .count ("I DIE, I DIE" )
1510
1510
1511
1511
1512
1512
def test_install_log (script : PipTestEnvironment , data : TestData , tmpdir : Path ) -> None :
@@ -1526,22 +1526,9 @@ def test_install_topological_sort(script: PipTestEnvironment, data: TestData) ->
1526
1526
assert order1 in res or order2 in res , res
1527
1527
1528
1528
1529
- def test_install_wheel_broken (script : PipTestEnvironment ) -> None :
1530
- res = script .pip_install_local ("wheelbroken" , allow_stderr_error = True )
1531
- assert "ERROR: Failed building wheel for wheelbroken" in res .stderr
1532
- # Fallback to setup.py install (https://github.com/pypa/pip/issues/8368)
1533
- assert "Successfully installed wheelbroken-0.1" in str (res ), str (res )
1534
-
1535
-
1536
1529
def test_cleanup_after_failed_wheel (script : PipTestEnvironment ) -> None :
1537
- res = script .pip_install_local ("wheelbrokenafter" , allow_stderr_error = True )
1530
+ res = script .pip_install_local ("wheelbrokenafter" , expect_error = True )
1538
1531
assert "ERROR: Failed building wheel for wheelbrokenafter" in res .stderr
1539
- # One of the effects of not cleaning up is broken scripts:
1540
- script_py = script .bin_path / "script.py"
1541
- assert script_py .exists (), script_py
1542
- with open (script_py ) as f :
1543
- shebang = f .readline ().strip ()
1544
- assert shebang != "#!python" , shebang
1545
1532
# OK, assert that we *said* we were cleaning up:
1546
1533
# /!\ if in need to change this, also change test_pep517_no_legacy_cleanup
1547
1534
assert "Running setup.py clean for wheelbrokenafter" in str (res ), str (res )
@@ -1568,38 +1555,26 @@ def test_install_builds_wheels(script: PipTestEnvironment, data: TestData) -> No
1568
1555
"-f" ,
1569
1556
data .find_links ,
1570
1557
to_install ,
1571
- allow_stderr_error = True , # error building wheelbroken
1572
- )
1573
- expected = (
1574
- "Successfully installed requires-wheelbroken-upper-0"
1575
- " upper-2.0 wheelbroken-0.1"
1558
+ expect_error = True , # error building wheelbroken
1576
1559
)
1577
- # Must have installed it all
1578
- assert expected in str (res ), str (res )
1579
1560
wheels : List [str ] = []
1580
1561
for _ , _ , files in os .walk (wheels_cache ):
1581
1562
wheels .extend (f for f in files if f .endswith (".whl" ))
1582
- # and built wheels for upper and wheelbroken
1563
+ # Built wheel for upper
1583
1564
assert "Building wheel for upper" in str (res ), str (res )
1565
+ # Built wheel for wheelbroken, but failed
1584
1566
assert "Building wheel for wheelb" in str (res ), str (res )
1567
+ assert "Failed to build wheelbroken" in str (res ), str (res )
1585
1568
# Wheels are built for local directories, but not cached.
1586
1569
assert "Building wheel for requir" in str (res ), str (res )
1587
- # wheelbroken has to run install
1588
1570
# into the cache
1589
1571
assert wheels != [], str (res )
1590
- # and installed from the wheel
1591
- assert "Running setup.py install for upper" not in str (res ), str (res )
1592
- # Wheels are built for local directories, but not cached.
1593
- assert "Running setup.py install for requir" not in str (res ), str (res )
1594
- # wheelbroken has to run install
1595
- assert "Running setup.py install for wheelb" in str (res ), str (res )
1596
- # We want to make sure pure python wheels do not have an implementation tag
1597
1572
assert wheels == [
1598
1573
"Upper-2.0-py{}-none-any.whl" .format (sys .version_info [0 ]),
1599
1574
]
1600
1575
1601
1576
1602
- def test_install_no_binary_disables_building_wheels (
1577
+ def test_install_no_binary_builds_wheels (
1603
1578
script : PipTestEnvironment , data : TestData
1604
1579
) -> None :
1605
1580
to_install = data .packages .joinpath ("requires_wheelbroken_upper" )
@@ -1610,22 +1585,14 @@ def test_install_no_binary_disables_building_wheels(
1610
1585
"-f" ,
1611
1586
data .find_links ,
1612
1587
to_install ,
1613
- allow_stderr_error = True , # error building wheelbroken
1588
+ expect_error = True , # error building wheelbroken
1614
1589
)
1615
- expected = (
1616
- "Successfully installed requires-wheelbroken-upper-0"
1617
- " upper-2.0 wheelbroken-0.1"
1618
- )
1619
- # Must have installed it all
1620
- assert expected in str (res ), str (res )
1621
- # and built wheels for wheelbroken only
1590
+ # Wheels are built for all requirements
1622
1591
assert "Building wheel for wheelb" in str (res ), str (res )
1623
- # Wheels are built for local directories, but not cached across runs
1624
1592
assert "Building wheel for requir" in str (res ), str (res )
1625
- # Don't build wheel for upper which was blacklisted
1626
1593
assert "Building wheel for upper" in str (res ), str (res )
1627
- # And these two fell back to sdist based installed.
1628
- assert "Running setup.py install for wheelb " in str (res ), str (res )
1594
+ # Wheelbroken failed to build
1595
+ assert "Failed to build wheelbroken " in str (res ), str (res )
1629
1596
1630
1597
1631
1598
@pytest .mark .network
0 commit comments