Some fixes for classic package downgrade tests and also workaround macos installers not preserving the extras directory (for now)

This commit is contained in:
MKLeb 2023-08-28 16:54:15 -04:00 committed by Pedro Algarvio
parent dabc91ce75
commit 688dc4a832

View file

@ -1,3 +1,5 @@
import shutil
import packaging.version
import pytest
from pytestskipmarkers.utils import platform
@ -36,7 +38,7 @@ def test_salt_downgrade(salt_call_cli, install_salt):
# Downgrade Salt to the previous version and test
install_salt.install(downgrade=True)
bin_file = "salt"
bin_file = shutil.which("salt")
if platform.is_windows():
if not is_downgrade_to_relenv:
bin_file = install_salt.install_dir / "salt-call.bat"
@ -51,7 +53,8 @@ def test_salt_downgrade(salt_call_cli, install_salt):
# Windows does not keep the extras directory around in the same state
# TODO: Fix this problem in windows installers
if is_downgrade_to_relenv and not platform.is_windows():
# TODO: Fix this problem in macos installers
if is_downgrade_to_relenv and not (platform.is_windows() or platform.is_darwin()):
new_py_version = install_salt.package_python_version()
if new_py_version == original_py_version:
# test pip install after a downgrade