From 915f1a6bb9f234c070ee93f42f61533733d72618 Mon Sep 17 00:00:00 2001 From: Steve Dower Date: Thu, 1 May 2025 22:50:11 +0100 Subject: [PATCH] Allow test_exec_with_literal_default to pass when runtime isn't installed. --- tests/test_commands.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tests/test_commands.py b/tests/test_commands.py index c273f25..796b503 100644 --- a/tests/test_commands.py +++ b/tests/test_commands.py @@ -1,6 +1,7 @@ import pytest import secrets from manage import commands +from manage.exceptions import NoInstallsError def test_pymanager_help_command(assert_log): @@ -46,4 +47,11 @@ def test_help_with_error_command(assert_log): def test_exec_with_literal_default(): cmd = commands.load_default_config(None) - assert cmd.get_install_to_run("default", None) + try: + assert cmd.get_install_to_run("default", None) + except ValueError: + # This is our failure case! + raise + except NoInstallsError: + # This is also an okay result, if the default runtime isn't installed + pass