diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-google-auth/0001-make-the-TLS-tests-skip-when-pyopenssl-isn-t-availab.patch')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-google-auth/0001-make-the-TLS-tests-skip-when-pyopenssl-isn-t-availab.patch | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-google-auth/0001-make-the-TLS-tests-skip-when-pyopenssl-isn-t-availab.patch b/meta-python/recipes-devtools/python/python3-google-auth/0001-make-the-TLS-tests-skip-when-pyopenssl-isn-t-availab.patch new file mode 100644 index 0000000000..5ee13f3d63 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-google-auth/0001-make-the-TLS-tests-skip-when-pyopenssl-isn-t-availab.patch | |||
| @@ -0,0 +1,34 @@ | |||
| 1 | From 35eea881e1aeb27fc12cfb301e497e72e59e720f Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Tue, 18 Nov 2025 17:23:09 -0800 | ||
| 4 | Subject: [PATCH] make the TLS tests skip when pyopenssl isn't available | ||
| 5 | |||
| 6 | In some distributions e.g. yocto | ||
| 7 | pyOpenSSL is a packageconfig and disabled by default, | ||
| 8 | and it means pyopenssl.py module is not installed as a result. | ||
| 9 | |||
| 10 | This test fails plainly when it can not find urllib3.contrib.pyopenssl | ||
| 11 | instead skip the test if it does not find the module. | ||
| 12 | |||
| 13 | Upstream-Status: Submitted [https://github.com/googleapis/google-auth-library-python/pull/1873] | ||
| 14 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 15 | --- | ||
| 16 | tests/transport/test__custom_tls_signer.py | 5 ++++- | ||
| 17 | 1 file changed, 4 insertions(+), 1 deletion(-) | ||
| 18 | |||
| 19 | diff --git a/tests/transport/test__custom_tls_signer.py b/tests/transport/test__custom_tls_signer.py | ||
| 20 | index 3a33c2c..6f88ddf 100644 | ||
| 21 | --- a/tests/transport/test__custom_tls_signer.py | ||
| 22 | +++ b/tests/transport/test__custom_tls_signer.py | ||
| 23 | @@ -18,7 +18,10 @@ import os | ||
| 24 | import mock | ||
| 25 | import pytest # type: ignore | ||
| 26 | from requests.packages.urllib3.util.ssl_ import create_urllib3_context # type: ignore | ||
| 27 | -import urllib3.contrib.pyopenssl # type: ignore | ||
| 28 | +urllib3_pyopenssl = pytest.importorskip( | ||
| 29 | + "urllib3.contrib.pyopenssl", | ||
| 30 | + reason="urllib3.contrib.pyopenssl not available in this environment", | ||
| 31 | +) | ||
| 32 | |||
| 33 | from google.auth import exceptions | ||
| 34 | from google.auth.transport import _custom_tls_signer | ||
