Skip to content

Commit

Permalink
Add test case for test_create::test_target_prefix
Browse files Browse the repository at this point in the history
This adds the case to simulate what happens when
${MAMBA_ROOT_PREFIX}/envs already exists.
  • Loading branch information
holzman committed Feb 5, 2025
1 parent b5e197f commit e7d1398
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions micromamba/tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ def test_env_logging_overhead_regression(tmp_home, tmp_root_prefix, tmp_path):
"similar_non_canonical,non_canonical_position",
((False, None), (True, "append"), (True, "prepend")),
)
@pytest.mark.parametrize("root_prefix_env_exists", (False, True))
def test_target_prefix(
tmp_home,
tmp_root_prefix,
Expand All @@ -266,6 +267,7 @@ def test_target_prefix(
current_target_prefix_fallback,
similar_non_canonical,
non_canonical_position,
root_prefix_env_exists
):
cmd = []

Expand All @@ -277,6 +279,9 @@ def test_target_prefix(
else:
root_prefix = Path(os.environ["MAMBA_ROOT_PREFIX"])

if root_prefix_env_exists:
os.mkdir((Path(os.environ["MAMBA_ROOT_PREFIX"]) / "envs"))

env_prefix = tmp_path / "myenv"

if target_is_root:
Expand Down

0 comments on commit e7d1398

Please sign in to comment.