From c02d66b2d3221c0c5f5e8f2cb2ae218f1e325a0a Mon Sep 17 00:00:00 2001 From: historia Date: Mon, 24 Aug 2026 01:57:13 -0400 Subject: feat: manage venv for all backends --- tests/test_backends.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'tests/test_backends.py') diff --git a/tests/test_backends.py b/tests/test_backends.py index 8ee1be8..c0e8d4a 100644 --- a/tests/test_backends.py +++ b/tests/test_backends.py @@ -9,6 +9,13 @@ from backends import REGISTRY, detect_all, get class RegistryTests(unittest.TestCase): + def setUp(self): + # The registry is built lazily on first access (the backend modules + # pull in converter.tts and its deps, which are only available inside + # the managed venv). Trigger the build so these tests don't depend on + # another test class having called detect_all() first. + get("audiocpp") + def test_registry_has_the_three_backends(self): keys = [info.key for info in REGISTRY] self.assertEqual(keys, ["audiocpp", "qwen", "faster"]) @@ -138,6 +145,7 @@ class ServerRunningTests(unittest.TestCase): def test_true_for_open_port(self): import socket + from backends import common server = socket.socket(socket.AF_INET, socket.SOCK_STREAM) server.bind(("127.0.0.1", 0)) @@ -150,9 +158,10 @@ class ServerRunningTests(unittest.TestCase): server.close() def test_false_for_closed_port(self): - from backends import common # Pick an unused port by opening + closing a socket, then probe it. import socket + + from backends import common s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.bind(("127.0.0.1", 0)) _, port = s.getsockname() -- cgit v1.2.3