-
Notifications
You must be signed in to change notification settings - Fork 371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add reverse flag to list command #3705
Conversation
micromamba/tests/test_list.py
Outdated
@pytest.mark.parametrize("quiet_flag", ["", "-q", "--quiet"]) | ||
@pytest.mark.parametrize("env_selector", ["", "name", "prefix"]) | ||
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) | ||
def test_list(tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_selector, quiet_flag): | ||
def test_list(tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_selector, quiet_flag, reverse_flag): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is maybe beyond this PR because it wasn't done in the first place, but we should test the non --json
case as well (you could have missed adding the corresponding std::sort
, and no test would have pointed that...).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a test for the non --json case, but the part checking "conda-forge" is assuming that "res" always has the same format.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handling of flags might be useful to boil down the two tests into a single one handling all the flags.
mamba/micromamba/tests/test_env.py
Lines 74 to 75 in 3dcbf76
flags = filter(None, [json_flag]) | |
output = helpers.run_env("export", "-n", empty_env, *flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We discussed that IRL, let's forget about my last suggestion (it would make things more complicated than necessary).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM beyond a few comments from Hind and this review.
Can you edit the description of the PR to point to the issue you mentioned then? :)
For info, my review is basically Julien's review at this point. :) |
micromamba/tests/test_list.py
Outdated
@pytest.mark.parametrize("quiet_flag", ["", "-q", "--quiet"]) | ||
@pytest.mark.parametrize("env_selector", ["", "name", "prefix"]) | ||
@pytest.mark.parametrize("shared_pkgs_dirs", [True], indirect=True) | ||
def test_list(tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_selector, quiet_flag): | ||
def test_list(tmp_home, tmp_root_prefix, tmp_env_name, tmp_xtensor_env, env_selector, quiet_flag, reverse_flag): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This handling of flags might be useful to boil down the two tests into a single one handling all the flags.
mamba/micromamba/tests/test_env.py
Lines 74 to 75 in 3dcbf76
flags = filter(None, [json_flag]) | |
output = helpers.run_env("export", "-n", empty_env, *flags) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Just suggestions for cosmetic changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Final suggestion.
Adds one of the missing sub-command #3535