From e634fc2c701c25353f805dbe5fe52f67fa896b7d Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 7 Nov 2023 15:09:22 -0600 Subject: [PATCH] fix: send reply test failure with cython (#265) --- tests/test_send_reply.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/test_send_reply.py b/tests/test_send_reply.py index 7982480f..616ff8f3 100644 --- a/tests/test_send_reply.py +++ b/tests/test_send_reply.py @@ -1,4 +1,5 @@ import os +from unittest.mock import patch import pytest @@ -35,7 +36,8 @@ def send_message(self, msg: Message) -> None: def _setup_socket(self) -> None: pass - mock_message_bus = MockBus() + with patch("socket.socket.connect"): + mock_message_bus = MockBus() mock_message = Message( path="/test/path", interface="test.interface", member="test_member", serial=1 ) @@ -65,7 +67,8 @@ def send_message(self, msg: Message) -> None: def _setup_socket(self) -> None: pass - mock_message_bus = MockBus() + with patch("socket.socket.connect"): + mock_message_bus = MockBus() mock_message = Message( path="/test/path", interface="test.interface", member="test_member", serial=1 )