From 52a48123a851a6ed343072626502ceb36d7617e8 Mon Sep 17 00:00:00 2001 From: Bryce Larson Date: Wed, 9 Dec 2020 05:20:25 +0000 Subject: [PATCH] fix .0 tests --- tests/conftest.py | 2 -- tests/integration/test_installation.py | 5 ++++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/conftest.py b/tests/conftest.py index 5f0e1b6..090131b 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -41,8 +41,6 @@ def target_python_version(): @pytest.fixture(scope="session") def target_salt_version(): target_salt = os.environ["KITCHEN_SUITE"].split("-", 2)[-1].replace("-", ".") - if target_salt.endswith(".0") and float(target_salt) >= 3000: - target_salt = ".".join(target_salt.split(".")[:-1]) if target_salt in ("latest", "master"): pytest.skip("Don't have a specific salt version to test against") return target_salt diff --git a/tests/integration/test_installation.py b/tests/integration/test_installation.py index 81ed135..a2309c0 100644 --- a/tests/integration/test_installation.py +++ b/tests/integration/test_installation.py @@ -21,4 +21,7 @@ def test_target_python_version(host, target_python_version): def test_target_salt_version(host, target_salt_version): with host.sudo(): ret = host.salt("grains.item", "saltversion", "--timeout=120") - assert ret["saltversion"].startswith(target_salt_version) + if target_salt_version.endswith(".0"): + assert ret["saltversion"] == ".".join(target_salt_version.split(".")[:-1]) + else: + assert ret["saltversion"].startswith(target_salt_version)