summaryrefslogtreecommitdiff
path: root/tests/test_ssl.py
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2016-07-27 15:32:43 +0200
committerMatěj Cepl <mcepl@cepl.eu>2018-02-05 22:21:25 +0100
commitefe581320d3ceecc740f32625e33ff8633c4cdae (patch)
tree67e9d09b97be97966431199fe136bb6040353603 /tests/test_ssl.py
parentacb84440f9e5bcde100975a86e198b51d4c177a4 (diff)
downloadm2crypto-efe581320d3ceecc740f32625e33ff8633c4cdae.tar.gz
Switch off use of urllib.URLOpener for py3k.
It has been deprecated in py3k.
Diffstat (limited to 'tests/test_ssl.py')
-rw-r--r--tests/test_ssl.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tests/test_ssl.py b/tests/test_ssl.py
index e7d805e..96aa3ac 100644
--- a/tests/test_ssl.py
+++ b/tests/test_ssl.py
@@ -35,7 +35,7 @@ except ImportError:
import unittest
from M2Crypto import (Err, Rand, SSL, X509, ftpslib, httpslib, m2, m2urllib,
- m2urllib2, m2xmlrpclib, util)
+ m2urllib2, m2xmlrpclib, six, util)
from tests import plat_fedora
from tests.fips import fips_mode
@@ -875,12 +875,11 @@ class MiscSSLClientTestCase(BaseSSLClientTestCase):
class UrllibSSLClientTestCase(BaseSSLClientTestCase):
+ @unittest.skipIf(six.PY3, "urllib.URLOpener is deprecated in py3k")
def test_urllib(self):
pid = self.start_server(self.args)
try:
- with warnings.catch_warnings():
- warnings.simplefilter("ignore", DeprecationWarning)
- url = m2urllib.FancyURLopener()
+ url = m2urllib.FancyURLopener()
url.addheader('Connection', 'close')
u = url.open('https://%s:%s/' % (srv_host, self.srv_port))
data = u.read()