From cb3bc8b3e1f811d981b671f93aa7ac82bc4b8722 Mon Sep 17 00:00:00 2001 From: Lilleman auf Larv Date: Sun, 27 Sep 2026 14:34:27 +0200 Subject: [PATCH] Check for uv before running the floor suite, so its message is the only line --- bin/test_python_floor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/test_python_floor.py b/bin/test_python_floor.py index 081b5a4b..d855cec3 100644 --- a/bin/test_python_floor.py +++ b/bin/test_python_floor.py @@ -1,6 +1,7 @@ import os import pathlib import re +import shutil import subprocess import unittest @@ -16,8 +17,7 @@ class PythonFloor(unittest.TestCase): named = FLOOR.search((ROOT / "README.md").read_text(encoding="utf-8")) self.assertIsNotNone(named, "README.md's Install names `Python 3.N or newer`") suite = ["python", "-m", "unittest", "discover", "-s", "bin", "-p", "test_*.py"] - try: - ran = subprocess.run(["uv", "run", "--no-project", "--python", named.group(1), *suite], capture_output=True, cwd=ROOT, env={**os.environ, ON_FLOOR: "1"}, text=True) - except FileNotFoundError: + if shutil.which("uv") is None: self.fail("uv on PATH fetches the floor interpreter; see README.md's Test line") + ran = subprocess.run(["uv", "run", "--no-project", "--python", named.group(1), *suite], capture_output=True, cwd=ROOT, env={**os.environ, ON_FLOOR: "1"}, text=True) self.assertEqual(ran.returncode, 0, ran.stderr)