|
@@ 171-186 (lines=16) @@
|
| 168 |
|
return collection_name |
| 169 |
|
|
| 170 |
|
|
| 171 |
|
@pytest.fixture(scope="function") |
| 172 |
|
def binary_id_collection(request, connect): |
| 173 |
|
ori_collection_name = getattr(request.module, "collection_id", "test") |
| 174 |
|
collection_name = gen_unique_str(ori_collection_name) |
| 175 |
|
try: |
| 176 |
|
fields = gen_binary_default_fields(auto_id=True) |
| 177 |
|
connect.create_collection(collection_name, fields) |
| 178 |
|
except Exception as e: |
| 179 |
|
pytest.exit(str(e)) |
| 180 |
|
def teardown(): |
| 181 |
|
collection_names = connect.list_collections() |
| 182 |
|
for collection_name in collection_names: |
| 183 |
|
connect.drop_collection(collection_name, timeout=delete_timeout) |
| 184 |
|
request.addfinalizer(teardown) |
| 185 |
|
assert connect.has_collection(collection_name) |
| 186 |
|
return collection_name |
| 187 |
|
|
|
@@ 135-150 (lines=16) @@
|
| 132 |
|
return collection_name |
| 133 |
|
|
| 134 |
|
|
| 135 |
|
@pytest.fixture(scope="function") |
| 136 |
|
def id_collection(request, connect): |
| 137 |
|
ori_collection_name = getattr(request.module, "collection_id", "test") |
| 138 |
|
collection_name = gen_unique_str(ori_collection_name) |
| 139 |
|
try: |
| 140 |
|
fields = gen_default_fields(auto_id=True) |
| 141 |
|
connect.create_collection(collection_name, fields) |
| 142 |
|
except Exception as e: |
| 143 |
|
pytest.exit(str(e)) |
| 144 |
|
def teardown(): |
| 145 |
|
collection_names = connect.list_collections() |
| 146 |
|
for collection_name in collection_names: |
| 147 |
|
connect.drop_collection(collection_name, timeout=delete_timeout) |
| 148 |
|
request.addfinalizer(teardown) |
| 149 |
|
assert connect.has_collection(collection_name) |
| 150 |
|
return collection_name |
| 151 |
|
|
| 152 |
|
|
| 153 |
|
@pytest.fixture(scope="function") |