From 279e84da82c34011431b61eade0d526adbb306cd Mon Sep 17 00:00:00 2001 From: Serhii Ilin Date: Thu, 5 Dec 2024 16:33:07 +0200 Subject: [PATCH] fix(tests): added ability for test to get an up-to-date version mercurial. --- .../tests/vcs_operations/test_vcs_operations_bad_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/rhodecode/tests/vcs_operations/test_vcs_operations_bad_client.py b/rhodecode/tests/vcs_operations/test_vcs_operations_bad_client.py index 960b2c9f..ead09b20 100644 --- a/rhodecode/tests/vcs_operations/test_vcs_operations_bad_client.py +++ b/rhodecode/tests/vcs_operations/test_vcs_operations_bad_client.py @@ -21,6 +21,7 @@ Test suite for making push/pull operations, on specially modified INI files """ import pytest +from importlib.metadata import version from rhodecode.model.meta import Session from rhodecode.model.settings import SettingsModel @@ -65,7 +66,8 @@ class TestVCSOperationsOnUsingBadClient(object): # push fails repo is locked by other user ! push_url = rcstack.repo_clone_url(HG_REPO) stdout, stderr = _add_files_and_push("hg", tmpdir.strpath, clone_url=push_url) - msg = "Your hg client (version=mercurial/proto-1.0 (Mercurial 6.7.4)) is forbidden by security rules" + current_version = version('mercurial') + msg = f"Your hg client (version=mercurial/proto-1.0 (Mercurial {current_version})) is forbidden by security rules" assert msg in stderr def test_push_with_bad_client_repo_by_other_user_git(self, rcstack, tmpdir):