Skip to content

Commit 55eb67f

Browse files
committed
.compare dataframes instead of .equal
1 parent d0e3177 commit 55eb67f

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/test_examples/test_hk_kaitak_ags3_to_brgi_geodb.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -109,17 +109,19 @@ def test_kaitak_ags3_notebook_runs_and_creates_gpkg(examples_dir):
109109
},
110110
]
111111
for table in important_tables:
112-
df_output = gpd.read_file(gpkg_output_path, layer=table["table_name"])
113-
assert len(df_output) == table["no_rows"], (
112+
gdf_output = gpd.read_file(gpkg_output_path, layer=table["table_name"])
113+
assert len(gdf_output) == table["no_rows"], (
114114
f"The output GeoPackage {gpkg_output_path.name} table {table['table_name']} "
115-
f"has {len(df_output)} rows instead of {table['no_rows']}."
115+
f"has {len(gdf_output)} rows instead of {table['no_rows']}."
116116
)
117-
df_original = gpd.read_file(
117+
gdf_original = gpd.read_file(
118118
temp_original_gpkg_path, layer=table["table_name"]
119119
)
120-
assert df_original.equals(df_output), (
120+
gdf_diff = gdf_original.compare(gdf_output)
121+
assert gdf_diff.empty, (
121122
f"The original GeoPackage {temp_original_gpkg_path.name} and the output "
122-
f"GeoPackage {gpkg_output_path.name} have a different {table['table_name']} table."
123+
f"GeoPackage {gpkg_output_path.name} have a different {table['table_name']} table.\n"
124+
f"{gdf_diff}"
123125
)
124126

125127
# Remove the newly generated kaitak_gi.gpkg

0 commit comments

Comments
 (0)