A pytest plugin for testing QGIS python plugins
Project description
pytest-qgis
A pytest plugin for testing QGIS python plugins.
Features
This plugin makes it easier to write QGIS plugin tests with the help of some fixtures:
qgis_app
initializes and returns fully configuredQgsApplication
. This fixture is called automatically on the start of pytest session.qgis_canvas
initializes and returnsQgsMapCanvas
qgis_iface
returns mockedQgsInterface
new_project
makes sure that all the map layers and configurations are removed. This should be used with tests that add stuff toQgsProject
.qgis_processing
initializes the processing framework. This can be used when testing code that callsprocessing.run(...)
.
Requirements
This pytest plugin requires QGIS >= 3.10 to work.
Installation
Install with pip
:
pip install pytest-qgis
Contributing
Contributions are very welcome.
License
Distributed under the terms of the GNU GPL v2.0
license, "pytest-qgis" is free and open source software.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pytest-qgis-1.0.2.tar.gz
(18.5 kB
view hashes)
Built Distribution
Close
Hashes for pytest_qgis-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec55fc347fe8a2e82ac1de6ab10c8a0c8f71977bee5fe0e7709bcc6202e857b7 |
|
MD5 | c9149ff0aa2dba16d99a8a5f1efedcf9 |
|
BLAKE2b-256 | 0e2a3da8a97349395e7ac92b47e96079fd9a2d6b9eb960af0833595d67aabb24 |