From b90956ce785dd86e1815ba3e2ddc6f71af27c5aa Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 5 Sep 2024 12:05:01 -0400 Subject: [PATCH] tests: add module case to uv detection (#813) Signed-off-by: Henry Schreiner --- tests/test_env.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/test_env.py b/tests/test_env.py index 1fcd6855..beade335 100644 --- a/tests/test_env.py +++ b/tests/test_env.py @@ -1,6 +1,7 @@ # SPDX-License-Identifier: MIT from __future__ import annotations +import importlib.util import logging import shutil import subprocess @@ -21,7 +22,8 @@ IS_PYPY = sys.implementation.name == 'pypy' IS_WINDOWS = sys.platform.startswith('win') -MISSING_UV = not shutil.which('uv') + +MISSING_UV = importlib.util.find_spec('uv') is None and not shutil.which('uv') @pytest.mark.isolated