Репозиторий Sisyphus
Последнее обновление: 1 октября 2023 | Пакетов: 18631 | Посещений: 37886158
en ru br
Репозитории ALT

Группа :: Development/Python3
Пакет: python3-module-requests

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: requests-2.28.1-tests-Skip-tests-requiring-configured-network.patch
Скачать


From a05221f404a3a908588d00144dd038b0fe28ac7a Mon Sep 17 00:00:00 2001
From: Stanislav Levin <slev@altlinux.org>
Date: Tue, 26 Jul 2022 15:37:11 +0300
Subject: [PATCH] tests: Skip tests requiring configured network
Some tests expect reachable 10.255.255.1. Hasher doesn't configure
network due to security reasons.
---
 tests/test_requests.py | 8 ++++++++
 1 file changed, 8 insertions(+)
diff --git a/tests/test_requests.py b/tests/test_requests.py
index 8b1f927b..918dc300 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2428,6 +2428,10 @@ class TestTimeout:
     @pytest.mark.parametrize(
         "timeout", ((0.1, None), Urllib3Timeout(connect=0.1, read=None))
     )
+    @pytest.mark.skipif(
+        os.environ.get("NO_INTERNET") is not None,
+        reason="Requires configured network",
+    )
     def test_connect_timeout(self, timeout):
         try:
             requests.get(TARPIT, timeout=timeout)
@@ -2439,6 +2443,10 @@ class TestTimeout:
     @pytest.mark.parametrize(
         "timeout", ((0.1, 0.1), Urllib3Timeout(connect=0.1, read=0.1))
     )
+    @pytest.mark.skipif(
+        os.environ.get("NO_INTERNET") is not None,
+        reason="Requires configured network",
+    )
     def test_total_timeout_connect(self, timeout):
         try:
             requests.get(TARPIT, timeout=timeout)
-- 
2.33.3
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin