mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
#6623: Add explicit deprecation warning for ftplib.Netrc.
This commit is contained in:
parent
8aa164b395
commit
87632f1a9e
3 changed files with 18 additions and 1 deletions
|
@ -985,8 +985,19 @@ class TestTimeouts(TestCase):
|
|||
ftp.close()
|
||||
|
||||
|
||||
class TestNetrcDeprecation(TestCase):
|
||||
|
||||
def test_deprecation(self):
|
||||
with support.temp_cwd(), support.EnvironmentVarGuard() as env:
|
||||
env['HOME'] = os.getcwd()
|
||||
open('.netrc', 'w').close()
|
||||
with self.assertWarns(DeprecationWarning):
|
||||
ftplib.Netrc()
|
||||
|
||||
|
||||
|
||||
def test_main():
|
||||
tests = [TestFTPClass, TestTimeouts]
|
||||
tests = [TestFTPClass, TestTimeouts, TestNetrcDeprecation]
|
||||
if support.IPV6_ENABLED:
|
||||
tests.append(TestIPv6Environment)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue