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 433 forks source link

Fix asserts for called once in Python 3.12 #2448

Closed hrnciar closed 10 months ago

hrnciar commented 1 year ago

Since Python 3.12 the tests fail with: AttributeError: 'called_once_with' is not a valid assertion. Use a spec for the mock if 'called_once_with' is meant to be an attribute.. Did you mean: 'assert_called_once_with'?

While attempting to fix them we find out that the tests were not asserting anything in the past. This PR tries to solve it.

carlosperate commented 10 months ago

Thanks for the PR @hrnciar, not sure why the tests didn't run, even if I changed the base branch (sometime that helps GitHub reset PRs). So I've rebased and pushed to your branch, and now it looks like the CI has been finally triggered.

Once the tests pass we can merge the PR 👍