1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
Description: Fix ImportError with unreachable http_proxy.
Author: Bas Couwenberg <sebastic@debian.org>
Forwarded: https://github.com/rasterio/rasterio/pull/2737
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -27,8 +27,13 @@ DEFAULT_SHAPE = (10, 10)
if sys.version_info > (3,):
reduce = functools.reduce
+try:
+ have_credentials = boto3.Session().get_credentials()
+except Exception:
+ have_credentials = False
+
credentials = pytest.mark.skipif(
- not(boto3.Session().get_credentials()),
+ not(have_credentials),
reason="S3 raster access requires credentials")
|