1 Star 0 Fork 30

gaoch_100/python-requests

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
Remove-tests-that-use-the-tarpit.patch 1.85 KB
一键复制 编辑 原始数据 按行查看 历史
orange-snn 提交于 2019-12-28 09:22 +08:00 . init
From 524cd22fb77e69db9bb3f017bbb1d9782c37b0cd Mon Sep 17 00:00:00 2001
From: Jeremy Cline <jeremy@jcline.org>
Date: Tue, 13 Jun 2017 09:08:09 -0400
Subject: [PATCH] Remove tests that use the tarpit
The latest version of Mock has started using systemd containers. The
systemd-nspawn command is being run with --private-network, which
immediately kills connections to something other than localhost. These
tests depend on the connection not being killed immediately and that
they are never responded to.
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
---
tests/test_requests.py | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/tests/test_requests.py b/tests/test_requests.py
index b8350cb..46b7e9e 100755
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2049,31 +2049,6 @@ class TestTimeout:
except ReadTimeout:
pass
- @pytest.mark.parametrize(
- 'timeout', (
- (0.1, None),
- Urllib3Timeout(connect=0.1, read=None)
- ))
- def test_connect_timeout(self, timeout):
- try:
- requests.get(TARPIT, timeout=timeout)
- pytest.fail('The connect() request should time out.')
- except ConnectTimeout as e:
- assert isinstance(e, ConnectionError)
- assert isinstance(e, Timeout)
-
- @pytest.mark.parametrize(
- 'timeout', (
- (0.1, 0.1),
- Urllib3Timeout(connect=0.1, read=0.1)
- ))
- def test_total_timeout_connect(self, timeout):
- try:
- requests.get(TARPIT, timeout=timeout)
- pytest.fail('The connect() request should time out.')
- except ConnectTimeout:
- pass
-
def test_encoded_methods(self, httpbin):
"""See: https://github.com/requests/requests/issues/2316"""
r = requests.request(b'GET', httpbin('get'))
--
2.9.4
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/gaoch_100/python-requests.git
git@gitee.com:gaoch_100/python-requests.git
gaoch_100
python-requests
python-requests
master

搜索帮助