Testing, CI & Docker
Proving a GIS workflow still works, and shipping it somewhere reproducible.
Testing GIS code is mostly a design problem wearing a testing costume. Code that reads a fixed path, transforms, and writes a fixed path has no seams to test; push the I/O to the edges and the interesting part becomes a function from a GeoDataFrame to a GeoDataFrame, which is trivially testable.
The second question is what to assert. A byte-for-byte comparison of WKT breaks the day GEOS reorders a ring, and tells you nothing about why. Properties — validity, CRS, row count, area within a tolerance, geometry type — survive upgrades that preserve the meaning and fail the ones that do not. That is also why the container is part of the test: in this stack the library versions are half the behaviour.
The pages below cover fixtures, temporary paths, round-trip and golden-file tests, and getting the whole thing to run in CI without running out of memory.
🧭 Start with the concepts
The ideas the how-to guides below assume you already have.
⚙️ Then do the task
Step-by-step walkthroughs with code you can copy and adapt.
- How to Containerise a Python GIS Pipeline with Docker
- How to Test a GIS Pipeline with pytest
- How to Run a Python GIS Pipeline in CI with GitHub Actions
- How to Assert on Geometry in pytest Without Flaky Comparisons
- How to Test a GIS Script That Reads and Writes Files
- How to Build a Small, Fast Python GIS Docker Image
🔧 When it breaks
The errors this topic produces, with the cause explained rather than just the command.
Learning paths through this topic
A curated route rather than a list — the guides in the order that builds on itself.
Related topics
Subjects that keep coming up alongside this one, most overlap first.