commit:     e1677d9005fffa13c4998c7a868129c111b8d336
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Nov 28 07:05:33 2021 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Nov 28 07:06:03 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e1677d90

dev-python/requests: Update to upstream-approved patch

Upstream does not want to skip the test, so just move the import.
We are skipping it anyway because of Internet access.

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 .../files/requests-2.26.0-trustme-dep.patch        | 30 ++++++++++------------
 1 file changed, 14 insertions(+), 16 deletions(-)

diff --git a/dev-python/requests/files/requests-2.26.0-trustme-dep.patch 
b/dev-python/requests/files/requests-2.26.0-trustme-dep.patch
index b3a81659a9be..5542bb68da90 100644
--- a/dev-python/requests/files/requests-2.26.0-trustme-dep.patch
+++ b/dev-python/requests/files/requests-2.26.0-trustme-dep.patch
@@ -1,22 +1,20 @@
-From 6a1b5cbc124e0c3362ddefae5939db5c216a74db Mon Sep 17 00:00:00 2001
+From 55da533a87afe188282b7f8dfbadeb30c21743d8 Mon Sep 17 00:00:00 2001
 From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgo...@gentoo.org>
 Date: Sat, 27 Nov 2021 10:33:35 +0100
-Subject: [PATCH] Skip the test requiring trustme when it is not available
+Subject: [PATCH] Defer the trustme import until inside the fixture
 
-Modify the nosan_server fixture to cause test_https_warnings to be
-skipped when trustme is not installed on the system, rather than causing
-the whole test suite to fail unconditionally.  This makes it possible
-to run all the remaining tests on systems where trustme cannot be
-installed due to its dependencies.
+Move the trustme import from global scope into the nosan_server fixture
+in order to make it possible to deselect the test via command-line
+when trustme is not available.
 ---
- tests/conftest.py | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
+ tests/conftest.py | 5 ++++-
+ 1 file changed, 4 insertions(+), 1 deletion(-)
 
 diff --git a/tests/conftest.py b/tests/conftest.py
-index 099462cf..5d38f254 100644
+index 099462cf52..4f9b2641b4 100644
 --- a/tests/conftest.py
 +++ b/tests/conftest.py
-@@ -13,7 +13,6 @@ import threading
+@@ -13,7 +13,6 @@
  
  import pytest
  from requests.compat import urljoin
@@ -24,14 +22,14 @@ index 099462cf..5d38f254 100644
  
  
  def prepare_url(value):
-@@ -38,6 +37,7 @@ def httpbin_secure(httpbin_secure):
+@@ -38,6 +37,10 @@ def httpbin_secure(httpbin_secure):
  
  @pytest.fixture
  def nosan_server(tmp_path_factory):
-+    trustme = pytest.importorskip('trustme')
++    # delay importing until the fixture in order to make it possible
++    # to deselect the test via command-line when trustme is not available
++    import trustme
++
      tmpdir = tmp_path_factory.mktemp("certs")
      ca = trustme.CA()
      # only commonName, no subjectAltName
--- 
-2.34.1
-

Reply via email to