diff --git a/tests20/python_client/common/common_func.py b/tests20/python_client/common/common_func.py index 5b05bb6e6d..c6794d526e 100644 --- a/tests20/python_client/common/common_func.py +++ b/tests20/python_client/common/common_func.py @@ -160,8 +160,9 @@ def gen_invalid_field_types(): def gen_all_type_fields(): fields = [] for k, v in DataType.__members__.items(): - field = FieldSchema(name=k.lower(), dtype=v) - fields.append(field) + if v != DataType.UNKNOWN: + field = FieldSchema(name=k.lower(), dtype=v) + fields.append(field) return fields diff --git a/tests20/python_client/requirements.txt b/tests20/python_client/requirements.txt index c7de4737ec..63a4611f05 100644 --- a/tests20/python_client/requirements.txt +++ b/tests20/python_client/requirements.txt @@ -1,6 +1,9 @@ +--extra-index-url https://test.pypi.org/simple/ pytest==5.3.4 sklearn==0.0 numpy==1.18.1 +pandas +numpy pytest-html==3.1.1 -pymilvus-orm==0.0.1 git+https://github.com/Projectplace/pytest-tags +pymilvus-orm==2.0a1.dev8 diff --git a/tests20/python_client/testcases/test_collection.py b/tests20/python_client/testcases/test_collection.py index c1c25af45a..67ef1bab20 100644 --- a/tests20/python_client/testcases/test_collection.py +++ b/tests20/python_client/testcases/test_collection.py @@ -51,10 +51,6 @@ class TestCollectionParams(ApiReq): pytest.skip("skip []") yield request.param - @pytest.fixture(scope="function", params=cf.gen_invalid_field_types()) - def get_invalid_field_type(self, request): - yield request.param - @pytest.fixture(scope="function", params=cf.gen_all_type_fields()) def get_unsupported_primary_field(self, request): if request.param.dtype == DataType.INT64: @@ -120,11 +116,10 @@ class TestCollectionParams(ApiReq): assert collection.name == dup_collection.name assert collection.schema == dup_collection.schema assert collection.num_entities == dup_collection.num_entities - assert id(collection) == id(dup_collection) assert collection.name in self.utility.list_collections() @pytest.mark.tags(CaseLabel.L1) - @pytest.mark.xfail(reason="issue #5231") + @pytest.mark.xfail(reason="issue #5367") def test_collection_dup_name_with_desc(self): """ target: test collection with dup name @@ -194,7 +189,6 @@ class TestCollectionParams(ApiReq): assert collection.primary_field is None @pytest.mark.tags(CaseLabel.L1) - @pytest.mark.xfail(reason="issue #5304") def test_collection_dup_name_invalid_schema_type(self, get_invalid_type_schema): """ target: test collection with dup name and invalid schema @@ -223,23 +217,23 @@ class TestCollectionParams(ApiReq): assert_default_collection(collection) dup_collection, _ = self.collection.collection_init(c_name, schema=default_schema) assert_default_collection(dup_collection, c_name) - assert id(collection) == id(dup_collection) @pytest.mark.tags(CaseLabel.L1) - @pytest.mark.xfail(reason="issue #5302") + # @pytest.mark.xfail(reason="issue #5302") def test_collection_dup_name_none_schema_dataframe(self): """ target: test collection with dup name and insert dataframe method: create collection with dup name, none schema, dataframe expected: two collection object is correct """ - self._connect() + conn = self._connect() nb = ct.default_nb collection = self._collection() c_name = collection.name assert_default_collection(collection) df = cf.gen_default_dataframe_data(nb) dup_collection, _ = self.collection.collection_init(c_name, schema=None, data=df) + conn.flush([c_name]) assert_default_collection(dup_collection, c_name, exp_num=nb) assert collection.num_entities == nb @@ -301,7 +295,6 @@ class TestCollectionParams(ApiReq): log.error(str(ex)) @pytest.mark.tags(CaseLabel.L1) - @pytest.mark.xfail(reason="issue #5407") def test_collection_with_unknown_type(self): """ target: test collection with unknown type @@ -310,12 +303,8 @@ class TestCollectionParams(ApiReq): """ self._connect() c_name = cf.gen_unique_str(prefix) - unknown_field = FieldSchema("unknown", DataType.UNKNOWN) - fields = [unknown_field, cf.gen_float_vec_field()] - schema = cf.gen_collection_schema(fields=fields) - ex, _ = self.collection.collection_init(c_name, schema=schema) - log.error(str(ex)) - # TODO assert + with pytest.raises(Exception, match="Field type not support