test: Adapt `test_remove_orphaned` unlinks (#3417)

* test: Adapt `test_remove_orphaned` unlinks

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

* Relax test by only checking for at least two unlinks' presence.

Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>

* Revert to the commented and previously used value

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>

Co-authored-by: Hind Montassif <hind.montassif@gmail.com>

* Revert "Revert to the commented and previously used value"

This reverts commit 009f982c54.

---------

Signed-off-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Hind-M <70631848+Hind-M@users.noreply.github.com>
Co-authored-by: Hind Montassif <hind.montassif@gmail.com>
This commit is contained in:
Julien Jerphanion 2024-08-29 14:22:35 +02:00 committed by GitHub
parent 0a01ecfc9d
commit 5251abaad0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 5 deletions

View File

@ -47,10 +47,7 @@ def test_remove_orphaned(tmp_home, tmp_root_prefix, tmp_xtensor_env, tmp_env_nam
assert keys.issubset(set(res.keys()))
assert res["success"]
if sys.platform == "darwin" and platform.machine() == "arm64":
assert len(res["actions"]["UNLINK"]) == 12
else:
assert len(res["actions"]["UNLINK"]) == 11
assert len(res["actions"]["UNLINK"]) > 1
assert res["actions"]["UNLINK"][0]["name"] == "xtensor-python"
assert res["actions"]["PREFIX"] == str(tmp_xtensor_env)
@ -64,7 +61,7 @@ def test_remove_orphaned(tmp_home, tmp_root_prefix, tmp_xtensor_env, tmp_env_nam
# assert len(res["actions"]["UNLINK"]) == len(env_pkgs) + (
assert len(res["actions"]["UNLINK"]) == 3 + (
1 if helpers.dry_run_tests == helpers.DryRun.DRY else 0
)
) + (platform.system() == "Linux") # xtl is not removed on Linux
for p in res["actions"]["UNLINK"]:
assert p["name"] in env_pkgs
assert res["actions"]["PREFIX"] == str(tmp_xtensor_env)