dev-python/moto: Backport 32-bit time_t test fix

Closes: https://bugs.gentoo.org/910504
Signed-off-by: Michał Górny <mgorny@gentoo.org>
This commit is contained in:
Michał Górny
2024-01-24 17:29:44 +01:00
parent 1fb62e8271
commit 6a8684f057
3 changed files with 56 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
From 7afd91fd23ad73550fcc621422e04a3734dc890d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
Date: Thu, 18 Jan 2024 13:32:07 +0100
Subject: [PATCH] Fix more test failures on platforms with 32-bit time_t
(#7222)
---
tests/test_acm/test_acm.py | 5 ++++-
tests/test_sagemaker/test_sagemaker_pipeline.py | 5 ++++-
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/tests/test_acm/test_acm.py b/tests/test_acm/test_acm.py
index d0c46d20c..d2943d801 100644
--- a/tests/test_acm/test_acm.py
+++ b/tests/test_acm/test_acm.py
@@ -92,7 +92,10 @@ def test_list_certificates():
issued_arn = _import_cert(client)
pending_arn = client.request_certificate(DomainName="google.com")["CertificateArn"]
- certs = client.list_certificates()["CertificateSummaryList"]
+ try:
+ certs = client.list_certificates()["CertificateSummaryList"]
+ except OverflowError:
+ pytest.skip("This test requires 64-bit time_t")
assert issued_arn in [c["CertificateArn"] for c in certs]
assert pending_arn in [c["CertificateArn"] for c in certs]
for cert in certs:
diff --git a/tests/test_sagemaker/test_sagemaker_pipeline.py b/tests/test_sagemaker/test_sagemaker_pipeline.py
index 8323eb29b..31443b26b 100644
--- a/tests/test_sagemaker/test_sagemaker_pipeline.py
+++ b/tests/test_sagemaker/test_sagemaker_pipeline.py
@@ -515,7 +515,10 @@ def test_list_pipelines_created_after(sagemaker_client):
_ = create_sagemaker_pipelines(sagemaker_client, pipelines)
created_after_str = "2099-12-31 23:59:59"
- response = sagemaker_client.list_pipelines(CreatedAfter=created_after_str)
+ try:
+ response = sagemaker_client.list_pipelines(CreatedAfter=created_after_str)
+ except OverflowError:
+ pytest.skip("This test requires 64-bit time_t")
assert not response["PipelineSummaries"]
created_after_datetime = datetime.strptime(created_after_str, "%Y-%m-%d %H:%M:%S")
--
2.43.0

View File

@@ -58,6 +58,11 @@ BDEPEND="
EPYTEST_XDIST=1
distutils_enable_tests pytest
PATCHES=(
# https://github.com/getmoto/moto/pull/7222
"${FILESDIR}/${PN}-4.2.12-32bit-time.patch"
)
python_test() {
local EPYTEST_DESELECT=(
# TODO

View File

@@ -58,6 +58,11 @@ BDEPEND="
EPYTEST_XDIST=1
distutils_enable_tests pytest
PATCHES=(
# https://github.com/getmoto/moto/pull/7222
"${FILESDIR}/${PN}-4.2.12-32bit-time.patch"
)
python_test() {
local EPYTEST_DESELECT=(
# TODO