Skip to content

Commit

Permalink
Apply changes from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mrclary committed Mar 5, 2024
1 parent e103465 commit 7df37d6
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions spyder/utils/tests/test_conda.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
# Local imports
from spyder.config.base import running_in_ci
from spyder.config.utils import is_anaconda
from spyder.plugins.ipythonconsole.tests.conftest import get_conda_test_env
from spyder.utils.conda import (
add_quotes, find_conda, get_conda_activation_script, get_conda_env_path,
get_conda_root_prefix, get_list_conda_envs, get_list_conda_envs_cache,
get_spyder_conda_channel)


if not is_anaconda():
pytest.skip("Requires conda to be installed", allow_module_level=True)

Expand Down Expand Up @@ -65,12 +65,18 @@ def test_get_conda_root_prefix():

@pytest.mark.skipif(not running_in_ci(), reason="Only meant for CIs")
def test_find_conda():
# Standard test
assert find_conda()

# Test with test environment
# Temporarily remove CONDA_EXE and MAMBA_EXE, if present
conda_exe = os.environ.pop('CONDA_EXE', None)
mamba_exe = os.environ.pop('MAMBA_EXE', None)

assert find_conda()
pyexec = get_conda_test_env()[1]
assert find_conda(pyexec)

# Restore os.environ
if conda_exe is not None:
os.environ['CONDA_EXE'] = conda_exe
if mamba_exe is not None:
Expand Down

0 comments on commit 7df37d6

Please sign in to comment.