GispoCoding / pytest-qgis

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

Optionally raise errors if there are warnings or errors in form #48

Closed Joonalai closed 9 months ago

Joonalai commented 9 months ago

QgisBot.create_feature_with_attribute_dialog ignored possible errors and warnings in the form. This caused lot of confusion why constraint error is not caught in test.

This PR:

I chose to leave the default values of ignore_warnings and ignore_errors to False since it is important that the writer of the test conciders whether to ignore warnings and errors or to fix the underlying problem in some other way.

New release with incremented minor version should be released when this is included. I recommend fixing #47 before the release as well.

codecov-commenter commented 9 months ago

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (1895072) 56.44% compared to head (5af0250) 56.94%.

Files Patch % Lines
src/pytest_qgis/utils.py 33.33% 4 Missing :warning:
src/pytest_qgis/qgis_bot.py 93.75% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #48 +/- ## ========================================== + Coverage 56.44% 56.94% +0.50% ========================================== Files 7 7 Lines 489 511 +22 ========================================== + Hits 276 291 +15 - Misses 213 220 +7 ``` | [Flag](https://app.codecov.io/gh/GispoCoding/pytest-qgis/pull/48/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GispoCoding) | Coverage Δ | | |---|---|---| | [pytest](https://app.codecov.io/gh/GispoCoding/pytest-qgis/pull/48/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GispoCoding) | `56.94% <77.27%> (+0.50%)` | :arrow_up: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=GispoCoding#carryforward-flags-in-the-pull-request-comment) to find out more.

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

Joonalai commented 9 months ago

@LKajan, could you merge this?