Skip to content

armgit / txtai

Public Imported from GitHub
0

💡 All-in-one AI framework for semantic search, LLM orchestration and language model workflows

Fix test that was using a method deprecated in Python 3.10

davidmezzetti408a053001e0
diff --git a/test/python/testapi/testapiworkflow.py b/test/python/testapi/testapiworkflow.py
index 474a325f..0bcf528d 100644
--- a/test/python/testapi/testapiworkflow.py
+++ b/test/python/testapi/testapiworkflow.py
@@ -166,8 +166,7 @@ class TestWorkflow(unittest.TestCase):
cls.httpd = HTTPServer(("127.0.0.1", 8001), RequestHandler)
- server = Thread(target=cls.httpd.serve_forever)
- server.setDaemon(True)
+ server = Thread(target=cls.httpd.serve_forever, daemon=True)
server.start()
@classmethod
diff --git a/test/python/testapi/testcluster.py b/test/python/testapi/testcluster.py
index 2b5a488b..15108213 100644
--- a/test/python/testapi/testcluster.py
+++ b/test/python/testapi/testcluster.py
@@ -126,14 +126,12 @@ class TestCluster(unittest.TestCase):
cls.httpd1 = HTTPServer(("127.0.0.1", 8002), RequestHandler)
- server1 = Thread(target=cls.httpd1.serve_forever)
- server1.setDaemon(True)
+ server1 = Thread(target=cls.httpd1.serve_forever, daemon=True)
server1.start()
cls.httpd2 = HTTPServer(("127.0.0.1", 8003), RequestHandler)
- server2 = Thread(target=cls.httpd2.serve_forever)
- server2.setDaemon(True)
+ server2 = Thread(target=cls.httpd2.serve_forever, daemon=True)
server2.start()
# Index data
diff --git a/test/python/testpipeline/testllm/testlitellm.py b/test/python/testpipeline/testllm/testlitellm.py
index 381a1982..90ff80fb 100644
--- a/test/python/testpipeline/testllm/testlitellm.py
+++ b/test/python/testpipeline/testllm/testlitellm.py
@@ -57,8 +57,7 @@ class TestLiteLLM(unittest.TestCase):
cls.httpd = HTTPServer(("127.0.0.1", 8000), RequestHandler)
- server = Thread(target=cls.httpd.serve_forever)
- server.setDaemon(True)
+ server = Thread(target=cls.httpd.serve_forever, daemon=True)
server.start()
@classmethod
diff --git a/test/python/testvectors/testlitellm.py b/test/python/testvectors/testlitellm.py
index a279fcd5..5ff334fc 100644
--- a/test/python/testvectors/testlitellm.py
+++ b/test/python/testvectors/testlitellm.py
@@ -50,8 +50,7 @@ class TestLiteLLM(unittest.TestCase):
cls.httpd = HTTPServer(("127.0.0.1", 8004), RequestHandler)
- server = Thread(target=cls.httpd.serve_forever)
- server.setDaemon(True)
+ server = Thread(target=cls.httpd.serve_forever, daemon=True)
server.start()
@classmethod