Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/manage/installs.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,13 +247,14 @@
if not installs:
raise NoInstallsError

if not tag:
if not tag or tag.casefold() == "default".casefold():
# We know we want default, so try filtering first. If any are explicitly
# tagged (e.g. active venv), they will be the only candidates.
# Otherwise, we'll do a regular search as if 'default_tag' was provided.
default_installs = [i for i in installs if i.get("default")]
if default_installs:
installs = default_installs
tag = None

Check warning on line 257 in src/manage/installs.py

View check run for this annotation

Codecov / codecov/patch

src/manage/installs.py#L257

Added line #L257 was not covered by tests
else:
tag = tag_or_range(default_tag)
used_default = True
Expand Down
5 changes: 5 additions & 0 deletions tests/test_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,8 @@ def test_help_with_error_command(assert_log, monkeypatch):
r"Python installation manager \d+\.\d+.*",
assert_log.skip_until(rf"The command .*?pymanager-test {expect} -v -q.*"),
)


def test_exec_with_literal_default():
cmd = commands.load_default_config(None)
assert cmd.get_install_to_run("default", None)