1
1
import warnings
2
2
import sys
3
3
import errno
4
- import functools
5
4
import logging
6
5
import socket
7
6
import ssl
@@ -56,7 +55,7 @@ def setUp():
56
55
def onlyPy279OrNewer (test ):
57
56
"""Skips this test unless you are on Python 2.7.9 or later."""
58
57
59
- @functools .wraps (test )
58
+ @six .wraps (test )
60
59
def wrapper (* args , ** kwargs ):
61
60
msg = "{name} requires Python 2.7.9+ to run" .format (name = test .__name__ )
62
61
if sys .version_info < (2 , 7 , 9 ):
@@ -69,7 +68,7 @@ def wrapper(*args, **kwargs):
69
68
def onlyPy2 (test ):
70
69
"""Skips this test unless you are on Python 2.x"""
71
70
72
- @functools .wraps (test )
71
+ @six .wraps (test )
73
72
def wrapper (* args , ** kwargs ):
74
73
msg = "{name} requires Python 2.x to run" .format (name = test .__name__ )
75
74
if not six .PY2 :
@@ -82,7 +81,7 @@ def wrapper(*args, **kwargs):
82
81
def onlyPy3 (test ):
83
82
"""Skips this test unless you are on Python3.x"""
84
83
85
- @functools .wraps (test )
84
+ @six .wraps (test )
86
85
def wrapper (* args , ** kwargs ):
87
86
msg = "{name} requires Python3.x to run" .format (name = test .__name__ )
88
87
if six .PY2 :
@@ -105,7 +104,7 @@ def notBrotlipy():
105
104
def notSecureTransport (test ):
106
105
"""Skips this test when SecureTransport is in use."""
107
106
108
- @functools .wraps (test )
107
+ @six .wraps (test )
109
108
def wrapper (* args , ** kwargs ):
110
109
msg = "{name} does not run with SecureTransport" .format (name = test .__name__ )
111
110
if ssl_ .IS_SECURETRANSPORT :
@@ -118,7 +117,7 @@ def wrapper(*args, **kwargs):
118
117
def notOpenSSL098 (test ):
119
118
"""Skips this test for Python 3.4 and 3.5 macOS python.org distributions"""
120
119
121
- @functools .wraps (test )
120
+ @six .wraps (test )
122
121
def wrapper (* args , ** kwargs ):
123
122
is_stdlib_ssl = not ssl_ .IS_SECURETRANSPORT and not ssl_ .IS_PYOPENSSL
124
123
if is_stdlib_ssl and ssl .OPENSSL_VERSION == "OpenSSL 0.9.8zh 14 Jan 2016" :
@@ -153,7 +152,7 @@ def _has_route():
153
152
else :
154
153
raise
155
154
156
- @functools .wraps (test )
155
+ @six .wraps (test )
157
156
def wrapper (* args , ** kwargs ):
158
157
global _requires_network_has_route
159
158
@@ -172,7 +171,7 @@ def wrapper(*args, **kwargs):
172
171
173
172
174
173
def requires_ssl_context_keyfile_password (test ):
175
- @functools .wraps (test )
174
+ @six .wraps (test )
176
175
def wrapper (* args , ** kwargs ):
177
176
if (
178
177
not ssl_ .IS_PYOPENSSL and sys .version_info < (2 , 7 , 9 )
@@ -194,7 +193,7 @@ def fails_on_travis_gce(test):
194
193
https://github.com/urllib3/urllib3/pull/1475#issuecomment-440788064
195
194
"""
196
195
197
- @functools .wraps (test )
196
+ @six .wraps (test )
198
197
def wrapper (* args , ** kwargs ):
199
198
if os .environ .get ("TRAVIS_INFRA" ) in ("gce" , "unknown" ):
200
199
pytest .xfail ("%s is expected to fail on Travis GCE builds" % test .__name__ )
0 commit comments