Chih-Hsuan Yen pushed to branch main at Arch Linux / Packaging / Packages / 
aws-cli-v2


Commits:
cd91cea9 by Chih-Hsuan Yen at 2024-03-31T02:31:51+08:00
Cherry-pick a pytest 8 fix from botocore

- - - - -


2 changed files:

- PKGBUILD
- + pytest8.patch


Changes:

=====================================
PKGBUILD
=====================================
@@ -27,7 +27,8 @@ 
source=("https://awscli.amazonaws.com/awscli-$pkgver.tar.gz"{,.sig}
         allow-egg-info.diff
         botocore-2922.patch
         botocore-2924.patch
-        botocore-2990-rebased.patch)
+        botocore-2990-rebased.patch
+        pytest8.patch)
 sha256sums=('4acf1cbb9bd7f158d13276f18467d9f8fd8dde504e537141fe8899b1273f9d5c'
             'SKIP'
             '0267e41561ab2c46a97ebfb024f0b047aabc9e6b9866f204b2c1a84ee5810d63'
@@ -37,7 +38,8 @@ 
sha256sums=('4acf1cbb9bd7f158d13276f18467d9f8fd8dde504e537141fe8899b1273f9d5c'
             '6768df8667fe7fd827e6eef1c4cdb3eae25aba5806bbc725270200a585f62152'
             '62be6cad0f9039ae682abffd167181abbd4a690e2680867418c5542893d74b36'
             'aad8b863d9f9107c56401e71d76b71f526efd9f8efac31e2a007b9071f85b5b6'
-            'a43c3e9aba8974fc09f1780a37b6a94108b15dbbbcecdf6d9e7e224ca135816b')
+            'a43c3e9aba8974fc09f1780a37b6a94108b15dbbbcecdf6d9e7e224ca135816b'
+            '77a02400b5ce0ff832b2ea1b292937ecf4169196b267d0fdfb6be1fbb5ba3a01')
 validpgpkeys=(
   'FB5DB77FD5C118B80511ADA8A6310ACC4672475C'  # the key mentioned on 
https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html
 )
@@ -64,6 +66,10 @@ prepare() {
   # tests/dependencies checks dependencies, and many Arch Linux packages are 
not using PEP 517 yet
   patch -Np1 -i ../allow-egg-info.diff
 
+  # Fix pytest-8.0.0 test failures due to incorrect pytest.warns()
+  # https://github.com/aws/aws-cli/pull/8610 (unmerged)
+  patch -Np1 -i ../pytest8.patch
+
   # Backport fixes for urllib3 2.x to vendored botocore
   pushd awscli
   # [Defer to system defaults for cipher suites with urllib3 
2.0+](https://github.com/boto/botocore/pull/2922)


=====================================
pytest8.patch
=====================================
@@ -0,0 +1,49 @@
+From 426ce33adc76579c1b6583e99ec3fff106208bc8 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
+Date: Thu, 1 Feb 2024 00:23:25 +0100
+Subject: [PATCH] Fix pytest-8.0.0 test failures due to incorrect
+ `pytest.warns()`
+
+This is a port of https://github.com/boto/botocore/pull/3109
+
+Remove two incorrect `pytest.warns()` invocations
+for `.get_component('internal')`, in order to fix test failures
+with pytest 8.0.0.  This version of pytest fixes `pytest.warns()` to
+work inside `pytest.raises()`, and therefore causes the tests to fail
+because the warning is not emitted when `get_component()` raises
+`ValueError`.
+---
+ tests/unit/botocore/test_session.py        | 4 +---
+ tests/unit/botocore/test_session_legacy.py | 4 +---
+ 2 files changed, 2 insertions(+), 6 deletions(-)
+
+diff --git a/tests/unit/botocore/test_session.py 
b/tests/unit/botocore/test_session.py
+index 4ff16e13120a..78eb3e64119b 100644
+--- a/tests/unit/botocore/test_session.py
++++ b/tests/unit/botocore/test_session.py
+@@ -640,9 +640,7 @@ def test_internal_component(self):
+         self.assertIs(
+             self.session._get_internal_component('internal'), component)
+         with self.assertRaises(ValueError):
+-            # get_component has been deprecated to the public
+-            with pytest.warns(DeprecationWarning):
+-                self.session.get_component('internal')
++            self.session.get_component('internal')
+ 
+     def test_internal_endpoint_resolver_is_same_as_deprecated_public(self):
+         endpoint_resolver = self.session._get_internal_component(
+diff --git a/tests/unit/botocore/test_session_legacy.py 
b/tests/unit/botocore/test_session_legacy.py
+index 27659c96ec16..2c2e00c6078b 100644
+--- a/tests/unit/botocore/test_session_legacy.py
++++ b/tests/unit/botocore/test_session_legacy.py
+@@ -631,9 +631,7 @@ def test_internal_component(self):
+         self.assertIs(
+             self.session._get_internal_component('internal'), component)
+         with self.assertRaises(ValueError):
+-            # get_component has been deprecated to the public
+-            with pytest.warns(DeprecationWarning):
+-                self.session.get_component('internal')
++            self.session.get_component('internal')
+ 
+     def test_internal_endpoint_resolver_is_same_as_deprecated_public(self):
+         endpoint_resolver = self.session._get_internal_component(



View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/aws-cli-v2/-/commit/cd91cea935b943554f753e067af041130d144d69

-- 
View it on GitLab: 
https://gitlab.archlinux.org/archlinux/packaging/packages/aws-cli-v2/-/commit/cd91cea935b943554f753e067af041130d144d69
You're receiving this email because of your account on gitlab.archlinux.org.


Reply via email to