From c451fef8d13ec54604e039f7cb07f0b7578009e6 Mon Sep 17 00:00:00 2001 From: Francisco Ramirez de Anton Date: Fri, 22 Sep 2023 10:20:57 +0200 Subject: [PATCH] Using regex instead of literal Path.cwd() --- tests/test_smoke.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tests/test_smoke.py b/tests/test_smoke.py index 0f02e209..d766f6b6 100644 --- a/tests/test_smoke.py +++ b/tests/test_smoke.py @@ -1,5 +1,6 @@ import os import platform +import re import shutil import subprocess import tempfile @@ -293,20 +294,18 @@ def test_propagate_non_default_compiler(self, capfd, chdir_build): assert 'tools.build:compiler_executables={"c":"/usr/bin/clang","cpp":"/usr/bin/clang++"}' in out class TestProfileCustomization: - def test_profile_defults(self, capfd, chdir_build): + def test_profile_defaults(self, capfd, chdir_build): """Test the defaults passed for host and build profiles""" run(f"cmake --fresh .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Release", check=True) - builddir = str(Path.cwd()).replace('\\','/') out, _ = capfd.readouterr() - assert f"--profile:host={builddir}/conan_host_profile" in out + assert re.search("--profile:host=.*/build/conan_host_profile", out) # buildir assert "--profile:build=default" in out def test_profile_composed_list(self, capfd, chdir_build): """Test passing a list of profiles to host and build profiles""" run(f'cmake --fresh .. -DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake -DCMAKE_BUILD_TYPE=Release -DCONAN_HOST_PROFILE="autodetect;foo" -DCONAN_BUILD_PROFILE="default;bar"', check=True) - builddir = str(Path.cwd()).replace('\\','/') out, err = capfd.readouterr() - assert f"--profile:host={builddir}/conan_host_profile" in out + assert re.search("--profile:host=.*/build/conan_host_profile", out) # buildir assert "--profile:host=foo" in out assert "user:custom_info=foo" in err assert "--profile:build=default" in out