Skip to content

Commit dff6a48

Browse files
committed
add assertion for error message
1 parent 072123f commit dff6a48

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/catalog/test_hive.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -976,9 +976,10 @@ def test_rename_table_to_table_already_exists(hive_table: HiveTable) -> None:
976976
catalog = HiveCatalog(HIVE_CATALOG_NAME, uri=HIVE_METASTORE_FAKE_URL)
977977
catalog.load_table = MagicMock(return_value=hive_table) # type: ignore[method-assign]
978978

979-
with pytest.raises(TableAlreadyExistsError):
979+
with pytest.raises(TableAlreadyExistsError) as exc_info:
980980
catalog.rename_table(("default", "some_table"), ("default", "new_tabl2e"))
981981

982+
assert "Table already exists: new_tabl2e" in str(exc_info.value)
982983

983984
def test_drop_database_does_not_empty() -> None:
984985
catalog = HiveCatalog(HIVE_CATALOG_NAME, uri=HIVE_METASTORE_FAKE_URL)

0 commit comments

Comments
 (0)