refactor: replace patch.object(logger) with caplog in Weaviate tests#38400
refactor: replace patch.object(logger) with caplog in Weaviate tests#38400BlueLi66 wants to merge 2 commits into
Conversation
Pyrefly Diffbase → PR--- /tmp/pyrefly_base.txt 2026-07-04 04:49:21.126380568 +0000
+++ /tmp/pyrefly_pr.txt 2026-07-04 04:49:06.071280925 +0000
@@ -453,13 +453,13 @@
ERROR Object of class `ModuleType` has no attribute `VikingDBService` [missing-attribute]
--> providers/vdb/vdb-vikingdb/tests/unit_tests/test_vikingdb_vector.py:76:5
ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_weaviate.weaviate_vector.WeaviateVector.get_collection_name` [bad-argument-type]
- --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:170:39
+ --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:171:39
ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_weaviate.weaviate_vector.WeaviateVector.get_collection_name` [bad-argument-type]
- --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:177:43
+ --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:178:43
ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_weaviate.weaviate_vector.WeaviateVectorFactory.init_vector` [bad-argument-type]
- --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:891:42
+ --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:892:42
ERROR Argument `SimpleNamespace` is not assignable to parameter `dataset` with type `Dataset` in function `dify_vdb_weaviate.weaviate_vector.WeaviateVectorFactory.init_vector` [bad-argument-type]
- --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:920:42
+ --> providers/vdb/vdb-weaviate/tests/unit_tests/test_weaviate_vector.py:921:42
ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
--> tests/helpers/legacy_model_type_migration.py:64:16
ERROR Object of class `FromClause` has no attribute `metadata` [missing-attribute]
|
Pyrefly Type Coverage
|
|
=========================== short test summary info ============================ |
Replace
patch.object(logger)with pytestcaplogfixture in Weaviate vector tests.test_shutdown_client_logs_debug_when_close_fails: usecaplog.at_level(logging.DEBUG)test_create_collection_logs_and_reraises_errors: usecaplog.at_level(logging.ERROR)test_ensure_properties_logs_warning_when_property_addition_fails: usecaplog.at_level(logging.WARNING)#37468
This is my first try in "good issue"