|
36 | 36 | from pyiceberg.schema import Schema |
37 | 37 | from tests.conftest import clean_up |
38 | 38 |
|
39 | | -# The number of tables/databases used in list_table/namespace test |
40 | | -LIST_TEST_NUMBER = 2 |
41 | | - |
42 | 39 |
|
43 | 40 | @pytest.fixture(scope="function") |
44 | 41 | def memory_catalog(tmp_path: PosixPath) -> Generator[Catalog, None, None]: |
@@ -81,10 +78,15 @@ def rest_catalog() -> Generator[Catalog, None, None]: |
81 | 78 | def hive_catalog() -> Generator[Catalog, None, None]: |
82 | 79 | test_catalog = HiveCatalog( |
83 | 80 | "test_hive_catalog", |
84 | | - uri="thrift://localhost:9083", |
| 81 | + **{ |
| 82 | + "uri": "http://localhost:9083", |
| 83 | + "s3.endpoint": "http://localhost:9000", |
| 84 | + "s3.access-key-id": "admin", |
| 85 | + "s3.secret-access-key": "password", |
| 86 | + }, |
85 | 87 | ) |
86 | 88 | yield test_catalog |
87 | | - clean_up(test_catalog) |
| 89 | + clean_up(test_catalog, drop_if_cannot_purge=True) |
88 | 90 |
|
89 | 91 |
|
90 | 92 | @pytest.mark.integration |
@@ -201,7 +203,7 @@ def test_list_tables(test_catalog: Catalog, table_schema_nested: Schema, databas |
201 | 203 | for table_name in table_list: |
202 | 204 | test_catalog.create_table((database_name, table_name), table_schema_nested) |
203 | 205 | identifier_list = test_catalog.list_tables(database_name) |
204 | | - assert len(identifier_list) == LIST_TEST_NUMBER |
| 206 | + assert len(identifier_list) == len(table_list) |
205 | 207 | for table_name in table_list: |
206 | 208 | assert (database_name, table_name) in identifier_list |
207 | 209 |
|
@@ -263,7 +265,7 @@ def test_drop_table(test_catalog: Catalog, table_schema_nested: Schema, table_na |
263 | 265 | pytest.lazy_fixture("sqlite_catalog_memory"), |
264 | 266 | pytest.lazy_fixture("sqlite_catalog_file"), |
265 | 267 | pytest.lazy_fixture("rest_catalog"), |
266 | | - pytest.lazy_fixture("hive_catalog"), |
| 268 | + # NOTE: HiveCatalog does not support purge_table |
267 | 269 | ], |
268 | 270 | ) |
269 | 271 | def test_purge_table(test_catalog: Catalog, table_schema_nested: Schema, table_name: str, database_name: str) -> None: |
|
0 commit comments