|
|
f019b5 |
From 524cd22fb77e69db9bb3f017bbb1d9782c37b0cd Mon Sep 17 00:00:00 2001
|
|
|
f019b5 |
From: Jeremy Cline <jeremy@jcline.org>
|
|
|
f019b5 |
Date: Tue, 13 Jun 2017 09:08:09 -0400
|
|
|
f019b5 |
Subject: [PATCH] Remove tests that use the tarpit
|
|
|
f019b5 |
|
|
|
f019b5 |
The latest version of Mock has started using systemd containers. The
|
|
|
f019b5 |
systemd-nspawn command is being run with --private-network, which
|
|
|
f019b5 |
immediately kills connections to something other than localhost. These
|
|
|
f019b5 |
tests depend on the connection not being killed immediately and that
|
|
|
f019b5 |
they are never responded to.
|
|
|
f019b5 |
|
|
|
f019b5 |
Signed-off-by: Jeremy Cline <jeremy@jcline.org>
|
|
|
f019b5 |
---
|
|
|
f019b5 |
tests/test_requests.py | 25 -------------------------
|
|
|
f019b5 |
1 file changed, 25 deletions(-)
|
|
|
f019b5 |
|
|
|
f019b5 |
diff --git a/tests/test_requests.py b/tests/test_requests.py
|
|
|
f019b5 |
index b8350cb..46b7e9e 100755
|
|
|
f019b5 |
--- a/tests/test_requests.py
|
|
|
f019b5 |
+++ b/tests/test_requests.py
|
|
|
f019b5 |
@@ -2049,31 +2049,6 @@ class TestTimeout:
|
|
|
f019b5 |
except ReadTimeout:
|
|
|
f019b5 |
pass
|
|
|
f019b5 |
|
|
|
f019b5 |
- @pytest.mark.parametrize(
|
|
|
f019b5 |
- 'timeout', (
|
|
|
f019b5 |
- (0.1, None),
|
|
|
f019b5 |
- Urllib3Timeout(connect=0.1, read=None)
|
|
|
f019b5 |
- ))
|
|
|
f019b5 |
- def test_connect_timeout(self, timeout):
|
|
|
f019b5 |
- try:
|
|
|
f019b5 |
- requests.get(TARPIT, timeout=timeout)
|
|
|
f019b5 |
- pytest.fail('The connect() request should time out.')
|
|
|
f019b5 |
- except ConnectTimeout as e:
|
|
|
f019b5 |
- assert isinstance(e, ConnectionError)
|
|
|
f019b5 |
- assert isinstance(e, Timeout)
|
|
|
f019b5 |
-
|
|
|
f019b5 |
- @pytest.mark.parametrize(
|
|
|
f019b5 |
- 'timeout', (
|
|
|
f019b5 |
- (0.1, 0.1),
|
|
|
f019b5 |
- Urllib3Timeout(connect=0.1, read=0.1)
|
|
|
f019b5 |
- ))
|
|
|
f019b5 |
- def test_total_timeout_connect(self, timeout):
|
|
|
f019b5 |
- try:
|
|
|
f019b5 |
- requests.get(TARPIT, timeout=timeout)
|
|
|
f019b5 |
- pytest.fail('The connect() request should time out.')
|
|
|
f019b5 |
- except ConnectTimeout:
|
|
|
f019b5 |
- pass
|
|
|
f019b5 |
-
|
|
|
f019b5 |
def test_encoded_methods(self, httpbin):
|
|
|
f019b5 |
"""See: https://github.com/requests/requests/issues/2316"""
|
|
|
f019b5 |
r = requests.request(b'GET', httpbin('get'))
|
|
|
f019b5 |
--
|
|
|
f019b5 |
2.9.4
|
|
|
f019b5 |
|