diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2020-04-29 07:36:20 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-29 07:36:20 (GMT) |
commit | bfb1cf44658934cbcd9707fb717d6770c78fbeb3 (patch) | |
tree | a9dcce79d42f76509491b3d8b165f6737143cbc5 /Lib/test/test_imaplib.py | |
parent | bb4a585d903e7fe0a46ded8c2ee3f47435ad6a66 (diff) | |
download | cpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.zip cpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.tar.gz cpython-bfb1cf44658934cbcd9707fb717d6770c78fbeb3.tar.bz2 |
bpo-40275: Move transient_internet from test.support to socket_helper (GH-19711)
Diffstat (limited to 'Lib/test/test_imaplib.py')
-rw-r--r-- | Lib/test/test_imaplib.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/Lib/test/test_imaplib.py b/Lib/test/test_imaplib.py index ce60156..d1e3550 100644 --- a/Lib/test/test_imaplib.py +++ b/Lib/test/test_imaplib.py @@ -10,7 +10,7 @@ import calendar import threading import socket -from test.support import (reap_threads, verbose, transient_internet, +from test.support import (reap_threads, verbose, run_with_tz, run_with_locale, cpython_only) from test.support import hashlib_helper import unittest @@ -968,16 +968,16 @@ class RemoteIMAPTest(unittest.TestCase): imap_class = imaplib.IMAP4 def setUp(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.server = self.imap_class(self.host, self.port) def tearDown(self): if self.server is not None: - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.server.logout() def test_logincapa(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): for cap in self.server.capabilities: self.assertIsInstance(cap, str) self.assertIn('LOGINDISABLED', self.server.capabilities) @@ -986,7 +986,7 @@ class RemoteIMAPTest(unittest.TestCase): self.assertEqual(rs[0], 'OK') def test_logout(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): rs = self.server.logout() self.server = None self.assertEqual(rs[0], 'BYE', rs) @@ -999,7 +999,7 @@ class RemoteIMAP_STARTTLSTest(RemoteIMAPTest): def setUp(self): super().setUp() - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): rs = self.server.starttls() self.assertEqual(rs[0], 'OK') @@ -1039,24 +1039,24 @@ class RemoteIMAP_SSLTest(RemoteIMAPTest): server.logout() def test_logincapa(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): _server = self.imap_class(self.host, self.port) self.check_logincapa(_server) def test_logout(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): _server = self.imap_class(self.host, self.port) rs = _server.logout() self.assertEqual(rs[0], 'BYE', rs) def test_ssl_context_certfile_exclusive(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.assertRaises( ValueError, self.imap_class, self.host, self.port, certfile=CERTFILE, ssl_context=self.create_ssl_context()) def test_ssl_context_keyfile_exclusive(self): - with transient_internet(self.host): + with socket_helper.transient_internet(self.host): self.assertRaises( ValueError, self.imap_class, self.host, self.port, keyfile=CERTFILE, ssl_context=self.create_ssl_context()) |