File: needs_aws-proxyfix

package info (click to toggle)
toil 8.0.0-5
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 13,500 kB
  • sloc: python: 54,560; makefile: 290; sh: 168
file content (38 lines) | stat: -rw-r--r-- 1,229 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
From: "Michael R. Crusoe" <crusoe@debian.org>
Date: Tue, 18 Jun 2024 19:36:42 +0200
Subject: Skip AWS requiring tests when a broken proxy is set.

When building Debian packages we purposely set HTTP{,S}_PROXY to http://127.0.0.1:9/
to quickly avoid internet access.

Forwarded: https://github.com/DataBiosphere/toil/pull/5250
Last-Update: 2025-02-13
---
 src/toil/test/__init__.py | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/src/toil/test/__init__.py b/src/toil/test/__init__.py
index c9198a2..3d33f70 100644
--- a/src/toil/test/__init__.py
+++ b/src/toil/test/__init__.py
@@ -52,6 +52,8 @@ from toil.lib.memoize import memoize
 from toil.lib.threading import ExceptionalThread, cpu_count
 from toil.version import distVersion
 
+import botocore.exceptions
+
 logger = logging.getLogger(__name__)
 
 
@@ -402,6 +404,11 @@ def needs_aws_s3(test_item: MT) -> MT:
         return unittest.skip("Install Toil with the 'aws' extra to include this test.")(
             test_item
         )
+    except botocore.exceptions.ProxyConnectionError as e:
+        return unittest.skip(f"Proxy error: {e}, skipping this test.")(
+            test_item
+        )
+
     from toil.lib.aws import running_on_ec2
 
     if not (