core[minor],community[minor]: Upgrade all @root_validator() to @pre_init (#23841)

This PR introduces a @pre_init decorator that's a @root_validator(pre=True) but with all the defaults populated!
This commit is contained in:
Eugene Yurtsev
2024-07-08 16:09:29 -04:00
committed by GitHub
parent f152d6ed3d
commit 2c180d645e
114 changed files with 439 additions and 276 deletions

View File

@@ -277,9 +277,12 @@ async def async_gen_mock_streaming_response() -> AsyncGenerator[Dict, None]:
async def test_bedrock_async_streaming_call() -> None:
# Mock boto3 import
mock_boto3 = MagicMock()
session = MagicMock()
session.region_name = "region"
mock_boto3.Session.return_value = session
mock_boto3.Session.return_value.client.return_value = (
MagicMock()
) # Mocking the client method of the Session object
session # Mocking the client method of the Session object
)
with patch.dict(
"sys.modules", {"boto3": mock_boto3}