From 81d52d0f0902cd38ecd5355994849a5a8f1b5f5b Mon Sep 17 00:00:00 2001 From: Marcel Bargull Date: Fri, 10 Nov 2023 18:50:01 +0100 Subject: [PATCH] Tests: Don't test for semi-hard-coded paths Signed-off-by: Marcel Bargull --- tests/cli/test_main_metapackage.py | 9 +++------ tests/cli/test_main_render.py | 10 ++++------ 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/tests/cli/test_main_metapackage.py b/tests/cli/test_main_metapackage.py index 19312ae539..0065fe9349 100644 --- a/tests/cli/test_main_metapackage.py +++ b/tests/cli/test_main_metapackage.py @@ -38,8 +38,7 @@ def test_metapackage_build_number(testing_config, testing_workdir): main_metapackage.execute(args) test_path = glob( os.path.join( - sys.prefix, - "conda-bld", + testing_config.croot, testing_config.host_subdir, "metapackage_test_build_number-1.0-1.tar.bz2", ) @@ -61,8 +60,7 @@ def test_metapackage_build_string(testing_config, testing_workdir): main_metapackage.execute(args) test_path = glob( os.path.join( - sys.prefix, - "conda-bld", + testing_config.croot, testing_config.host_subdir, "metapackage_test_build_string-1.0-frank*.tar.bz2", ) @@ -88,8 +86,7 @@ def test_metapackage_metadata(testing_config, testing_workdir): test_path = glob( os.path.join( - sys.prefix, - "conda-bld", + testing_config.croot, testing_config.host_subdir, "metapackage_testing_metadata-1.0-0.tar.bz2", ) diff --git a/tests/cli/test_main_render.py b/tests/cli/test_main_render.py index 7f385118cc..9c423d1b43 100644 --- a/tests/cli/test_main_render.py +++ b/tests/cli/test_main_render.py @@ -66,13 +66,12 @@ def test_render_without_channel_fails(tmp_path): ), f"Expected to get only base package name because it should not be found, but got :{required_package_string}" -def test_render_output_build_path(testing_workdir, testing_metadata, capfd, caplog): +def test_render_output_build_path(testing_workdir, testing_config, testing_metadata, capfd, caplog): api.output_yaml(testing_metadata, "meta.yaml") args = ["--output", testing_workdir] main_render.execute(args) test_path = os.path.join( - sys.prefix, - "conda-bld", + testing_config.croot, testing_metadata.config.host_subdir, "test_render_output_build_path-1.0-1.tar.bz2", ) @@ -82,15 +81,14 @@ def test_render_output_build_path(testing_workdir, testing_metadata, capfd, capl def test_render_output_build_path_and_file( - testing_workdir, testing_metadata, capfd, caplog + testing_workdir, testing_config, testing_metadata, capfd, caplog ): api.output_yaml(testing_metadata, "meta.yaml") rendered_filename = "out.yaml" args = ["--output", "--file", rendered_filename, testing_workdir] main_render.execute(args) test_path = os.path.join( - sys.prefix, - "conda-bld", + testing_config.croot, testing_metadata.config.host_subdir, "test_render_output_build_path_and_file-1.0-1.tar.bz2", )