-
-
Notifications
You must be signed in to change notification settings - Fork 827
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add mamba support to
language: conda
- Loading branch information
Showing
2 changed files
with
51 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import pytest | ||
|
||
from pre_commit import envcontext | ||
from pre_commit.languages.conda import _conda_exe | ||
|
||
|
||
@pytest.mark.parametrize( | ||
('ctx', 'expected'), | ||
( | ||
pytest.param( | ||
( | ||
('PRE_COMMIT_USE_MICROMAMBA', envcontext.UNSET), | ||
('PRE_COMMIT_USE_MAMBA', envcontext.UNSET), | ||
), | ||
'conda', | ||
id='default', | ||
), | ||
pytest.param( | ||
( | ||
('PRE_COMMIT_USE_MICROMAMBA', '1'), | ||
('PRE_COMMIT_USE_MAMBA', ''), | ||
), | ||
'micromamba', | ||
id='default', | ||
), | ||
pytest.param( | ||
( | ||
('PRE_COMMIT_USE_MICROMAMBA', ''), | ||
('PRE_COMMIT_USE_MAMBA', '1'), | ||
), | ||
'mamba', | ||
id='default', | ||
), | ||
), | ||
) | ||
def test_conda_exe(ctx, expected): | ||
with envcontext.envcontext(ctx): | ||
assert _conda_exe() == expected |