Skip to content

Commit

Permalink
Clear libmamba .solv cache (#5428)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Jul 29, 2024
1 parent 6b222c7 commit 6dbdec8
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]
Expand Down

0 comments on commit 6dbdec8

Please sign in to comment.