mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-12-31 01:23:53 +00:00
20 lines
618 B
Python
20 lines
618 B
Python
# Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
# All rights reserved.
|
|
#
|
|
# This source code is licensed under the terms described in the LICENSE file in
|
|
# the root directory of this source tree.
|
|
|
|
import pytest
|
|
from unittest.mock import AsyncMock, MagicMock, patch
|
|
|
|
mock_session = MagicMock()
|
|
mock_session.closed = False
|
|
mock_session.close = AsyncMock()
|
|
mock_session.__aenter__ = AsyncMock(return_value=mock_session)
|
|
mock_session.__aexit__ = AsyncMock()
|
|
|
|
|
|
@pytest.fixture(scope="session", autouse=True)
|
|
def patch_aiohttp_session():
|
|
with patch("aiohttp.ClientSession", return_value=mock_session):
|
|
yield
|