From 28b3ef0dc2aff99756a1aa9348fab05c5beff82c Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Fri, 26 Jan 2024 12:53:01 +0100 Subject: [PATCH] TST: update error message in tests for GDAL 3.9 --- pyogrio/_io.pyx | 2 +- pyogrio/tests/test_geopandas_io.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pyogrio/_io.pyx b/pyogrio/_io.pyx index 12fb85a3..1608dcda 100644 --- a/pyogrio/_io.pyx +++ b/pyogrio/_io.pyx @@ -163,7 +163,7 @@ cdef void* ogr_open(const char* path_c, int mode, char** options) except NULL: ) from None except CPLE_BaseError as exc: - if str(exc).endswith("not recognized as a supported file format."): + if str(exc).endswith("a supported file format."): raise DataSourceError( f"{str(exc)} It might help to specify the correct driver explicitly by " "prefixing the file path with ':', e.g. 'CSV:path'." diff --git a/pyogrio/tests/test_geopandas_io.py b/pyogrio/tests/test_geopandas_io.py index 0ef95a99..20c3d9f4 100644 --- a/pyogrio/tests/test_geopandas_io.py +++ b/pyogrio/tests/test_geopandas_io.py @@ -889,7 +889,7 @@ def test_write_read_empty_dataframe_unsupported(tmp_path, ext): assert filename.exists() with pytest.raises( - Exception, match=".* not recognized as a supported file format." + Exception, match=".* not recognized as( being in)? a supported file format." ): _ = read_dataframe(filename)