From 9a5fd86953e6ff049d0208711584ca8cf4d009c5 Mon Sep 17 00:00:00 2001 From: Ken Odegard Date: Fri, 26 Jul 2024 13:11:46 -0500 Subject: [PATCH] Clear cache --- tests/test_api_build.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/test_api_build.py b/tests/test_api_build.py index 554bc452ae..efba89d75d 100644 --- a/tests/test_api_build.py +++ b/tests/test_api_build.py @@ -1963,8 +1963,13 @@ def test_activated_prefixes_in_actual_path(testing_metadata): @pytest.mark.parametrize("add_pip_as_python_dependency", [False, True]) def test_add_pip_as_python_dependency_from_condarc_file( - testing_metadata, testing_workdir, add_pip_as_python_dependency, monkeypatch -): + testing_metadata: MetaData, + testing_workdir: str | os.PathLike, + add_pip_as_python_dependency: bool, + monkeypatch: MonkeyPatch, + mocker: MockerFixture, + tmp_path: Path, +) -> None: """ Test whether settings from .condarc files are needed. ref: https://github.com/conda/conda-libmamba-solver/issues/393 @@ -1976,6 +1981,10 @@ def test_add_pip_as_python_dependency_from_condarc_file( # SubdirData's cache doesn't distinguish on add_pip_as_python_dependency. SubdirData._cache_.clear() + # clear cache + mocker.patch("conda.base.context.Context.pkgs_dirs", pkgs_dirs := (str(tmp_path),)) + assert context.pkgs_dirs == pkgs_dirs + testing_metadata.meta["build"]["script"] = ['python -c "import pip"'] testing_metadata.meta["requirements"]["host"] = ["python"] del testing_metadata.meta["test"]