GispoCoding / pytest-qgis

A pytest plugin for testing QGIS python plugins
GNU General Public License v2.0
29 stars 8 forks source link

Add processing framework initialization fixture and test #1

Closed joakimfors closed 2 years ago

joakimfors commented 2 years ago

Initialize the QGIS processing framework by guessing the path to the processing plugin and initializing it. The processing plugin init code takes care of monkey patching the processing package and loading all built in algorithm providers.

mvaaltola commented 2 years ago

Thank you for your contribution! Looks good and definitely something that is very useful to have in pytest-qgis.

Unfortunately the test fails on QGIS 3.10 as native:creategrid is not found. Changing it to qgis:creategrid should work as per https://docs.qgis.org/3.10/en/docs/user_manual/processing_algs/qgis/vectorcreation.html?highlight=creategrid#id6

Also, please add a short description to README.md.

joakimfors commented 2 years ago

Hadn't noticed the distinction between native and qgis as a provider id vis-a-vis QGIS version.

I wasn't certain that this fixture was in scope for this plugin so it's nice to hear that it is OK.

joakimfors commented 2 years ago

... and now to rebase. :)

joakimfors commented 2 years ago

Well this was "fun". Should have put in the effort to test 3.10 locally in docker from the start. Turns out creategrid is not available in the 3.10 docker image. Changed algo to one that is available (at the moment) in all targets and added a test to check if at least the qgis provider exists.

Do you want me to squash some commits to have a cleaner history?

Joonalai commented 2 years ago

Thank you, we really appreciate the time and effort you had with this contribution! :) No need to squash, I will do Squash and merge for this and make a new release afterwards.