summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOleg Pudeyev <p@users.noreply.github.com>2020-05-04 19:45:12 -0400
committerGitHub <noreply@github.com>2020-05-04 19:45:12 -0400
commitccca1153de8ec145b00f3bb9a6e6a13b0f02db58 (patch)
tree0973163a18c4cb7d6037e91d1ac571a316c711cf
parent7af66a1d50ed25671e3a99468c3c9f06b8b8b40a (diff)
parent1f747cc4194601e8e54084638085d60026f1dbc4 (diff)
downloadpycurl-ccca1153de8ec145b00f3bb9a6e6a13b0f02db58.tar.gz
Merge pull request #626 from mgorny/onlytelnet
Skip telnet tests when cURL is built without telnet support
-rw-r--r--tests/option_constants_test.py1
-rw-r--r--tests/util.py14
2 files changed, 15 insertions, 0 deletions
diff --git a/tests/option_constants_test.py b/tests/option_constants_test.py
index 2d6d185..20228c6 100644
--- a/tests/option_constants_test.py
+++ b/tests/option_constants_test.py
@@ -387,6 +387,7 @@ class OptionConstantsSettingTest(unittest.TestCase):
def test_keypasswd(self):
self.curl.setopt(self.curl.KEYPASSWD, 'secret')
+ @util.only_telnet
def test_telnetoptions(self):
self.curl.setopt(self.curl.TELNETOPTIONS, ('TTYPE=1', 'XDISPLOC=2'))
diff --git a/tests/util.py b/tests/util.py
index aabadf5..e12e251 100644
--- a/tests/util.py
+++ b/tests/util.py
@@ -138,6 +138,20 @@ def only_ssl(fn):
return decorated
+def only_telnet(fn):
+ import nose.plugins.skip
+ import pycurl
+
+ @functools.wraps(fn)
+ def decorated(*args, **kwargs):
+ # pycurl.version_info()[8] is a tuple of protocols supported by libcurl
+ if 'telnet' not in pycurl.version_info()[8]:
+ raise nose.plugins.skip.SkipTest('libcurl does not support telnet')
+
+ return fn(*args, **kwargs)
+
+ return decorated
+
def only_ssl_backends(*backends):
def decorator(fn):
import nose.plugins.skip