Skip to content

Commit

Permalink
Attempt at fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
SylvainCorlay committed Sep 18, 2024
1 parent 30e84b5 commit 69c11a7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions micromamba/tests/test_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ def test_target_prefix(

if not current_target_prefix_fallback:
os.environ.pop("CONDA_PREFIX", None)
os.environ.pop("CONDA_DEFAULT_ENV", None)
else:
os.environ["CONDA_PREFIX"] = str(p)

Expand Down
3 changes: 3 additions & 0 deletions micromamba/tests/test_install.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ def test_target_prefix(

if not current_target_prefix_fallback:
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")
else:
os.environ["CONDA_PREFIX"] = p

Expand All @@ -206,6 +207,7 @@ def test_target_prefix_with_no_settings(
# Get the actual set MAMBA_ROOT_PREFIX when setting up `TestInstall` class
os.environ["MAMBA_DEFAULT_ROOT_PREFIX"] = os.environ.pop("MAMBA_ROOT_PREFIX")
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")

# Fallback on root prefix
res = helpers.install(*cmd, "--print-config-only")
Expand All @@ -229,6 +231,7 @@ def test_target_prefix_with_no_settings_and_no_env_var(

os.environ.pop("MAMBA_ROOT_PREFIX")
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")

# Fallback on root prefix
res = helpers.install(*cmd, "--print-config-only")
Expand Down
3 changes: 3 additions & 0 deletions micromamba/tests/test_update.py
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,7 @@ def test_target_prefix(

if not current_target_prefix_fallback:
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")
else:
os.environ["CONDA_PREFIX"] = p

Expand All @@ -399,6 +400,7 @@ def test_target_prefix_with_no_settings(
# Get the actual set MAMBA_ROOT_PREFIX when setting up `TestUpdateConfig` class
os.environ["MAMBA_DEFAULT_ROOT_PREFIX"] = os.environ.pop("MAMBA_ROOT_PREFIX")
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")

# Fallback on root prefix
res = helpers.install(*cmd, "--print-config-only")
Expand All @@ -421,6 +423,7 @@ def test_target_prefix_with_no_settings_and_no_env_var(

os.environ.pop("MAMBA_ROOT_PREFIX")
os.environ.pop("CONDA_PREFIX")
os.environ.pop("CONDA_DEFAULT_ENV")

# Fallback on root prefix
res = helpers.install(*cmd, "--print-config-only")
Expand Down

0 comments on commit 69c11a7

Please sign in to comment.