GispoCoding / pytest-qgis

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

MockMessageBar pushMessage method has incorrect signature #26

Open couteau opened 2 years ago

couteau commented 2 years ago

Describe the bug MockMessageBar pushMessage method does not have the same signature as the actual QgsMessageBar pushMessage method

To Reproduce Steps to reproduce the behavior:

  1. Create a test plugin with a method that calls iface.messageBar().pushMessage('Test', Qgis.Warning) # without passing anything for the duration argument2.
  2. Create a unit test that calls the plugin test method3.

Expected behavior The unit test completes successfully

Environment (please complete the following information):

Additional context QgsMessageBar pushMessage has a default value for duration argument MockMessageBar pushMessage does not causing unit tests if any code that relies on the default duration to crash The signatures of the Mock class's pushMessage method and the real class's pushMessage method should be the same

Joonalai commented 1 year ago

Thank you for the issue. All the stub implementations should definitely be reviewed and updated to match the original classes.