Skip to content

Commit 7515687

Browse files
committed
reset thread cache after running tests
1 parent f9754f3 commit 7515687

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

aikido_zen/sinks/tests/socket_test.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,20 @@
66
import pytest
77
from unittest.mock import patch, MagicMock
88
import aikido_zen.sinks.socket # Import to ensure patching
9+
from aikido_zen.context import current_context
910
from aikido_zen.test_utils import generate_context
1011
from aikido_zen.thread.thread_cache import get_cache
1112
from aikido_zen.background_process.service_config import ServiceConfig
1213

1314

15+
@pytest.fixture(autouse=True)
16+
def run_around_tests():
17+
yield
18+
# Make sure to reset thread cache after every test
19+
get_cache().reset()
20+
current_context.set(None)
21+
22+
1423
def test_socket_getaddrinfo_no_blocking():
1524
"""Test that getaddrinfo works normally when no blocking is configured"""
1625
# Reset cache to ensure clean state

0 commit comments

Comments
 (0)