Skip to content

Commit

Permalink
Don't use legacy version numbers in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sbidoul committed Sep 29, 2023
1 parent 5817ef2 commit 63897d3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions tests/data/packages/README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ broken-0.1.tar.gz
-----------------
This package exists for testing uninstall-rollback.

broken-0.2broken.tar.gz
-----------------------
Version 0.2broken has a setup.py crafted to fail on install (and only on
broken-0.2.tar.gz
-----------------
Version 0.2 has a setup.py crafted to fail on install (and only on
install). If any earlier step would fail (i.e. egg-info-generation), the
already-installed version would never be uninstalled, so uninstall-rollback
would not come into play.
Expand Down
File renamed without changes.
6 changes: 4 additions & 2 deletions tests/functional/test_install_upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,17 +288,19 @@ def test_uninstall_rollback(script: PipTestEnvironment, data: TestData) -> None:
crafted to fail on install).
"""
# installing broken 0.1 succeeds
result = script.pip("install", "-f", data.find_links, "--no-index", "broken==0.1")
# installing broken 0.2 fails because it's setup.py is broken
result.did_create(script.site_packages / "broken.py")
result2 = script.pip(
"install",
"-f",
data.find_links,
"--no-index",
"broken===0.2broken",
"broken===0.2",
expect_error=True,
)
assert result2.returncode == 1, str(result2)
assert result2.returncode != 0, str(result2)
assert (
script.run("python", "-c", "import broken; print(broken.VERSION)").stdout
== "0.1\n"
Expand Down

0 comments on commit 63897d3

Please sign in to comment.