-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRemove-tests-that-use-the-tarpit.patch
55 lines (50 loc) · 1.85 KB
/
Remove-tests-that-use-the-tarpit.patch
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
From bb1c91432c5e9a1f402692db5c80c65136656afb Mon Sep 17 00:00:00 2001
From: Jeremy Cline <[email protected]>
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 <[email protected]>
---
tests/test_requests.py | 25 -------------------------
1 file changed, 25 deletions(-)
diff --git a/tests/test_requests.py b/tests/test_requests.py
index 7d4a4eb5..8d1c55fc 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -2186,31 +2186,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/psf/requests/issues/2316"""
r = requests.request(b'GET', httpbin('get'))
--
2.24.1