summaryrefslogtreecommitdiff
path: root/test/with_dummyserver/test_socketlevel.py
diff options
context:
space:
mode:
authorRan Benita <ran@unusedvar.com>2021-06-19 14:15:03 +0300
committerGitHub <noreply@github.com>2021-06-19 15:15:03 +0400
commitcdc0fcfac27fc4b1a2e8a8f692dbb19c94ce3b80 (patch)
treebcf42aeb6b877dfed0b787174726a9e16c9fd62e /test/with_dummyserver/test_socketlevel.py
parentc2fd715aed78325c2062ccc523e62c62121bca87 (diff)
downloadurllib3-cdc0fcfac27fc4b1a2e8a8f692dbb19c94ce3b80.tar.gz
Remove python2 compat stuff from test_socketlevel.py (#2276)
* Reformat imports in test_socketlevel.py Make the next commit more understandable. * Remove python2 compat stuff from test_socketlevel.py
Diffstat (limited to 'test/with_dummyserver/test_socketlevel.py')
-rw-r--r--test/with_dummyserver/test_socketlevel.py58
1 files changed, 22 insertions, 36 deletions
diff --git a/test/with_dummyserver/test_socketlevel.py b/test/with_dummyserver/test_socketlevel.py
index 0a2d587a..5da20de4 100644
--- a/test/with_dummyserver/test_socketlevel.py
+++ b/test/with_dummyserver/test_socketlevel.py
@@ -1,6 +1,27 @@
# TODO: Break this module up into pieces. Maybe group by functionality tested
# rather than the socket level-ness of it.
-import http.client as httplib
+import errno
+import os
+import os.path
+import select
+import shutil
+import socket
+import ssl
+import tempfile
+from collections import OrderedDict
+from test import (
+ LONG_TIMEOUT,
+ SHORT_TIMEOUT,
+ notSecureTransport,
+ notWindows,
+ requires_ssl_context_keyfile_password,
+ resolvesLocalhostFQDN,
+)
+from threading import Event
+from unittest import mock
+
+import pytest
+import trustme
from dummyserver.server import (
DEFAULT_CA,
@@ -26,37 +47,6 @@ from urllib3.util.timeout import Timeout
from .. import LogRecorder, has_alpn
-try:
- from mimetools import Message as MimeToolMessage
-except ImportError:
-
- class MimeToolMessage:
- pass
-
-
-import errno
-import os
-import os.path
-import select
-import shutil
-import socket
-import ssl
-import tempfile
-from collections import OrderedDict
-from test import (
- LONG_TIMEOUT,
- SHORT_TIMEOUT,
- notSecureTransport,
- notWindows,
- requires_ssl_context_keyfile_password,
- resolvesLocalhostFQDN,
-)
-from threading import Event
-from unittest import mock
-
-import pytest
-import trustme
-
# Retry failed tests
pytestmark = pytest.mark.flaky
@@ -1616,10 +1606,6 @@ class TestHeaders(SocketDummyServerTestCase):
assert expected_response_headers == actual_response_headers
-@pytest.mark.skipif(
- issubclass(httplib.HTTPMessage, MimeToolMessage),
- reason="Header parsing errors not available",
-)
class TestBrokenHeaders(SocketDummyServerTestCase):
def _test_broken_header_parsing(self, headers, unparsed_data_check=None):
self.start_response_handler(