Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MockMessageBar pushMessage method has incorrect signature #26

Open
couteau opened this issue Jul 9, 2022 · 1 comment · May be fixed by #54
Open

MockMessageBar pushMessage method has incorrect signature #26

couteau opened this issue Jul 9, 2022 · 1 comment · May be fixed by #54
Labels
bug Something isn't working

Comments

@couteau
Copy link

couteau commented Jul 9, 2022

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):

  • OS: MacOS
  • Python: 3.9
  • Cookiecutter: n/a

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

@couteau couteau added the bug Something isn't working label Jul 9, 2022
@Joonalai
Copy link
Contributor

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

Joonalai added a commit to Joonalai/pytest-qgis that referenced this issue Dec 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants