From 3430ad5f933cc066d251b2f7c501370e91b535bd Mon Sep 17 00:00:00 2001 From: Carlos Zoido Date: Thu, 14 Sep 2023 11:36:48 +0200 Subject: [PATCH] Change the default check=False in conan.tools.system.package_manager.Apt to True (#14728) * check if we can change default * fix arguments --- conan/tools/system/package_manager.py | 2 +- conans/test/integration/tools/system/package_manager_test.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conan/tools/system/package_manager.py b/conan/tools/system/package_manager.py index a274e96d949..87cb6b87174 100644 --- a/conan/tools/system/package_manager.py +++ b/conan/tools/system/package_manager.py @@ -234,7 +234,7 @@ def __init__(self, conanfile, arch_names=None): self._arch_separator = ":" - def install(self, packages, update=False, check=False, recommends=False): + def install(self, packages, update=False, check=True, recommends=False): """ Will try to install the list of packages passed as a parameter. Its behaviour is affected by the value of ``tools.system.package_manager:mode`` diff --git a/conans/test/integration/tools/system/package_manager_test.py b/conans/test/integration/tools/system/package_manager_test.py index 9c268e553c7..bf20c43d88c 100644 --- a/conans/test/integration/tools/system/package_manager_test.py +++ b/conans/test/integration/tools/system/package_manager_test.py @@ -100,7 +100,7 @@ def test_apt_install_recommends(recommends, recommends_str): with mock.patch('conan.ConanFile.context', new_callable=PropertyMock) as context_mock: context_mock.return_value = "host" apt = Apt(conanfile) - apt.install(["package1", "package2"], recommends=recommends) + apt.install(["package1", "package2"], recommends=recommends, check=False) assert apt._conanfile.command == "apt-get install -y {}package1 package2".format(recommends_str)