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.1.tar.gz
(18.3 kB
view hashes)
Built Distribution
Close
Hashes for pytest_qgis-1.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a2f660f9cd34594b30d5554d24d32d9fc6a12680a894c42024c01e48d38d4f54 |
|
MD5 | 5dc6029fe0a56202e481eac6a800e7aa |
|
BLAKE2b-256 | 0f6d0669a4037db4051388458aa986987364e0045a9aa61cff8972a77ab07525 |