QGIS plugin testing - Introduction and Automation
2026-10-06 , Bridge 2

Ideally, any bug fix, feature or refactoring in a QGIS plugin can be made safely, knowing that the quality checks of the testing framework of the plugin will catch any regressions introduced by the new or changed code.

In reality, getting there can be quite hard: How does one even start to write tests? How many tests does my plugin need? How can the interactive parts of the QGIS GUI be tested? And then, once tests are in place, how do I make sure that all PRs are tested? And what makes certain that the code commited to main actually passes all tests?

In this talk, we will showcase how to write tests for a QGIS plugin using pytest and how to automate running tests using the GitHub and GitLab CI.

All this is not done using a toy project, where often everything seems to neatly fall into place.
Instead, we will have a look at a real-world example: the ORSTools QGIS Plugin, showcased at QGIS UC 2025.