Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions tests/providers/amazon/aws/hooks/test_emr.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import annotations

import re
import sys
import warnings
from unittest import mock

Expand Down Expand Up @@ -171,6 +172,13 @@ def test_create_job_flow_extra_args(self):
with warnings.catch_warnings():
# Expected no warnings if ``emr_conn_id`` exists with correct conn_type
warnings.simplefilter("error")
if sys.version_info >= (3, 12):
# Ignore some modules' warnings in Python 3.12
warnings.filterwarnings(
"ignore",
module="botocore.auth",
message=r"datetime.datetime.utcnow\(\) is deprecated*",
)
cluster = hook.create_job_flow({"Name": "test_cluster", "ReleaseLabel": "", "AmiVersion": "3.2"})
cluster = client.describe_cluster(ClusterId=cluster["JobFlowId"])["Cluster"]

Expand Down
8 changes: 8 additions & 0 deletions tests/providers/amazon/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
from __future__ import annotations

import os
import sys
import warnings

try:
Expand Down Expand Up @@ -59,6 +60,13 @@ def filter_botocore_warnings(botocore_version):
module="botocore.client",
message="The .* client is currently using a deprecated endpoint.*",
)
if sys.version_info >= (3, 12):
# Ignore some modules' warnings in Python 3.12
warnings.filterwarnings(
"ignore",
module="botocore.auth",
message=r"datetime.datetime.utcnow\(\) is deprecated*",
)
yield


Expand Down