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