mu-editor / mu

A small, simple editor for beginner Python programmers. Written in Python and Qt5.
http://codewith.mu
GNU General Public License v3.0
1.39k stars 432 forks source link

Fix test calling `called_once_with()` instead of `assert_called_once_with()`. #2486

Closed carlosperate closed 6 months ago

carlosperate commented 6 months ago

A MagicMock object was being asserted with called_once_with() instead of assert_called_once_with(), likely an accidental mistake.

As a MagicMock always returns another instance of MagicMock on anything not previoysly set up, the assert was always passing, even though we updated the Window.connect_zoom() implementation and these asserts should be failing.

I only noticed this because in Python 3.12 this type of typo is caught and throws an exception.