mirror of
https://gitee.com/dify_ai/dify.git
synced 2024-12-01 10:48:37 +08:00
chore: skip warning messages when pytest auto-collecting the vdb test class by removing Test
prefix (#3906)
This commit is contained in:
parent
43a5ba9415
commit
661b30784e
@ -1,12 +1,12 @@
|
|||||||
from core.rag.datasource.vdb.milvus.milvus_vector import MilvusConfig, MilvusVector
|
from core.rag.datasource.vdb.milvus.milvus_vector import MilvusConfig, MilvusVector
|
||||||
from tests.integration_tests.vdb.test_vector_store import (
|
from tests.integration_tests.vdb.test_vector_store import (
|
||||||
AbstractTestVector,
|
AbstractVectorTest,
|
||||||
get_example_text,
|
get_example_text,
|
||||||
setup_mock_redis,
|
setup_mock_redis,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestMilvusVector(AbstractTestVector):
|
class MilvusVectorTest(AbstractVectorTest):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.vector = MilvusVector(
|
self.vector = MilvusVector(
|
||||||
@ -33,4 +33,4 @@ class TestMilvusVector(AbstractTestVector):
|
|||||||
|
|
||||||
|
|
||||||
def test_milvus_vector(setup_mock_redis):
|
def test_milvus_vector(setup_mock_redis):
|
||||||
TestMilvusVector().run_all_tests()
|
MilvusVectorTest().run_all_tests()
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
from core.rag.datasource.vdb.qdrant.qdrant_vector import QdrantConfig, QdrantVector
|
from core.rag.datasource.vdb.qdrant.qdrant_vector import QdrantConfig, QdrantVector
|
||||||
from tests.integration_tests.vdb.test_vector_store import (
|
from tests.integration_tests.vdb.test_vector_store import (
|
||||||
AbstractTestVector,
|
AbstractVectorTest,
|
||||||
setup_mock_redis,
|
setup_mock_redis,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestQdrantVector(AbstractTestVector):
|
class QdrantVectorTest(AbstractVectorTest):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.attributes = ['doc_id', 'dataset_id', 'document_id', 'doc_hash']
|
self.attributes = ['doc_id', 'dataset_id', 'document_id', 'doc_hash']
|
||||||
@ -20,4 +20,4 @@ class TestQdrantVector(AbstractTestVector):
|
|||||||
|
|
||||||
|
|
||||||
def test_qdrant_vector(setup_mock_redis):
|
def test_qdrant_vector(setup_mock_redis):
|
||||||
TestQdrantVector().run_all_tests()
|
QdrantVectorTest().run_all_tests()
|
||||||
|
@ -41,7 +41,7 @@ def setup_mock_redis() -> None:
|
|||||||
ext_redis.redis_client.lock = mock_redis_lock
|
ext_redis.redis_client.lock = mock_redis_lock
|
||||||
|
|
||||||
|
|
||||||
class AbstractTestVector:
|
class AbstractVectorTest:
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
self.vector = None
|
self.vector = None
|
||||||
self.dataset_id = str(uuid.uuid4())
|
self.dataset_id = str(uuid.uuid4())
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
from core.rag.datasource.vdb.weaviate.weaviate_vector import WeaviateConfig, WeaviateVector
|
from core.rag.datasource.vdb.weaviate.weaviate_vector import WeaviateConfig, WeaviateVector
|
||||||
from tests.integration_tests.vdb.test_vector_store import (
|
from tests.integration_tests.vdb.test_vector_store import (
|
||||||
AbstractTestVector,
|
AbstractVectorTest,
|
||||||
setup_mock_redis,
|
setup_mock_redis,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
class TestWeaviateVector(AbstractTestVector):
|
class WeaviateVectorTest(AbstractVectorTest):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
self.attributes = ['doc_id', 'dataset_id', 'document_id', 'doc_hash']
|
self.attributes = ['doc_id', 'dataset_id', 'document_id', 'doc_hash']
|
||||||
@ -20,4 +20,4 @@ class TestWeaviateVector(AbstractTestVector):
|
|||||||
|
|
||||||
|
|
||||||
def test_weaviate_vector(setup_mock_redis):
|
def test_weaviate_vector(setup_mock_redis):
|
||||||
TestWeaviateVector().run_all_tests()
|
WeaviateVectorTest().run_all_tests()
|
||||||
|
Loading…
Reference in New Issue
Block a user