Skip to content

Commit

Permalink
normal Mock
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-B committed Jul 1, 2024
1 parent d45ad27 commit fd398ff
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tests/test_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import time
from threading import Thread, Event
import pytest
from mock import Mock, MagicMock
from mock import Mock
from spalloc_client import (
Job, JobState, JobDestroyedError, ProtocolTimeoutError)
from spalloc_client._keepalive_process import keep_job_alive
Expand All @@ -31,16 +31,16 @@
@pytest.fixture
def client(monkeypatch):
# Mock out the client.
client = MagicMock()
client = Mock()
client.version.return_value = GOOD_VERSION
client.create_job.return_value = 123

import spalloc_client.job
monkeypatch.setattr(spalloc_client.job, "ProtocolClient",
MagicMock(return_value=client))
Mock(return_value=client))
import spalloc_client._keepalive_process
monkeypatch.setattr(spalloc_client._keepalive_process, "ProtocolClient",
MagicMock(return_value=client))
Mock(return_value=client))
return client


Expand Down

0 comments on commit fd398ff

Please sign in to comment.