diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2016-07-27 15:32:43 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2018-02-05 22:21:25 +0100 |
commit | efe581320d3ceecc740f32625e33ff8633c4cdae (patch) | |
tree | 67e9d09b97be97966431199fe136bb6040353603 /tests/test_ssl.py | |
parent | acb84440f9e5bcde100975a86e198b51d4c177a4 (diff) | |
download | m2crypto-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.py | 7 |
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() |