From a78ec78ffa33f79af736cc75e02280ab8915aa23 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20Rinc=C3=B3n?= Date: Mon, 27 Nov 2023 15:38:48 +0100 Subject: [PATCH] Add test showing that configure can set deprecated option just fin --- .../integration/deprecated/test_deprecated.py | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/conans/test/integration/deprecated/test_deprecated.py b/conans/test/integration/deprecated/test_deprecated.py index 8e027976288..acff0139f7b 100644 --- a/conans/test/integration/deprecated/test_deprecated.py +++ b/conans/test/integration/deprecated/test_deprecated.py @@ -1,3 +1,5 @@ +import textwrap + from conans.test.utils.tools import TestClient, GenConanfile @@ -39,3 +41,24 @@ def test_deprecated_custom_text(self): assert "maths/1.0: This is not secure, use maths/[>=2.0]" in tc.out tc.run("install --requires=maths/1.0") assert "maths/1.0: This is not secure, use maths/[>=2.0]" in tc.out + + def test_deprecated_configure(self): + tc = TestClient() + conanfile = textwrap.dedent(""" + from conan import ConanFile + from conan.tools.scm import Version + + class Pkg(ConanFile): + name = "pkg" + + def configure(self): + if Version(self.version) < "1.0": + self.deprecated = True + """) + tc.save({"conanfile.py": conanfile}) + + tc.run("graph info . --version=0.0") + assert "deprecated: True" in tc.out + + tc.run("graph info . --version=2.0") + assert "deprecated: None" in tc.out