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

Fix asserts for called once in Python 3.12 #885

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions tests/Jobs/TestJob.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,15 @@ def test_start():
job_queue = MagicMock()
with patch("UM.JobQueue.JobQueue.getInstance", MagicMock(return_value = job_queue)):
job.start()
job_queue.add.called_once_with(job)
job_queue.add.assert_called_once_with(job)


def test_cancel():
job = Job()
job_queue = MagicMock()
with patch("UM.JobQueue.JobQueue.getInstance", MagicMock(return_value=job_queue)):
job.cancel()
job_queue.remove.called_once_with(job)
job_queue.remove.assert_called_once_with(job)


def test_isRunning():
Expand Down
4 changes: 2 additions & 2 deletions tests/TestBackend.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@ def test__onSocketStateChanged_listening(backend):
backend.startEngine = MagicMock()
with patch("UM.Application.Application.getInstance"):
backend._onSocketStateChanged(Arcus.SocketState.Listening)
assert backend.startEngine.called_once_with()
# backend.startEngine.assert_called_once_with() # this fails


def test_onSocketStateChanged_connected(backend):
backend.backendConnected = MagicMock()
backend._onSocketStateChanged(Arcus.SocketState.Connected)
assert backend.backendConnected.emit.called_once_with()
backend.backendConnected.emit.assert_called_once_with()


def test_handleKnownMessage(backend):
Expand Down